util.BlastDamage

From GMod Wiki

Jump to: navigation, search
Function
Syntax util.BlastDamage( Weapon inflictor, Entity attacker, Vector position, Float radius, Float damage )
Where is this used?
Description:
Damages all entities near the specified position within the specified radius and gives any kills to the attacker.
Returns: nil
Part of Library: Util
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Util.BlastDamage]Util.BlastDamage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDeals up to 80 damage to all entities within a 1024 unit radius from the origin of the map (0,0,0), and gives any kills to a zombie.
Used onNewerShared.png
Code
local position = Vector(0,0,0)
local damage = 80
local radius = 1024
local zombies = ents.FindByClass("npc_zombie")
local attacker = zombies[1]
local inflictor = zombies[1]
 
util.BlastDamage(inflictor, attacker, position, radius, damage)
OutputAll entities within 1024 units of the map will recive damage, and the first zombie found will be given points for any entities killed.


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox