Garry's Mod Wiki


  boolean ENTITY:ImpactTrace( table traceResult, number damageType, string customImpactName = nil )


Called when a bullet trace hits this entity and allows you to override the default behavior by returning true.


1 table traceResult
The trace that hit this entity as a TraceResult structure.
2 number damageType
The damage bits associated with the trace, see DMG enum
3 string customImpactName = nil
The effect name to override the impact effect with. Possible arguments are ImpactJeep, AirboatGunImpact, HelicopterImpact, ImpactGunship.


1 boolean
Return true to override the default impact effects.


Hides the original bullet impact effect and dispatches explosions instead.

function ENT:ImpactTrace(trace,dmgtype,customimpactname) local effectdata = EffectData() effectdata:SetOrigin( trace.HitPos ) util.Effect( "Explosion", effectdata ) return true end