Garry's Mod Wiki

util.BlastDamage

  util.BlastDamage( Entity inflictor, Entity attacker, Vector damageOrigin, number damageRadius, number damage, number damageType )

Description

Applies explosion damage to all entities in the specified radius. Performs line-of-sight checking. This a simpler version of util.BlastDamageInfo

This function will not deal damage to the Hunter-Chopper type NPC. To deal damage, use the util.BlastDamageInfo function and add DMG_AIRBOAT to the damage type.

Arguments

1 Entity inflictor
The entity that caused the damage.
2 Entity attacker
The entity that attacked.
3 Vector damageOrigin
The center of the explosion
4 number damageRadius
The radius in which entities will be damaged.
5 number damage
The amount of damage to be applied.
6 number with DMG enum damageType
Added on November 2, 2026, but not included in any release.

Override the damage type

Example

Allow the Hunter-Chooper to take damage from explosions.

local target = ents.FindByClass("npc_helicopter")[1] if not target then return end util.BlastDamage( Entity(1), target, target:GetPos(), 200, 200, bit.bor( DMG_BLAST, DMG_AIRBOAT ))