Garry's Mod Wiki

ENTITY:ImpactTrace

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

Description

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

Arguments

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

Returns

1 boolean
Return true to override the default impact effects.

Example

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

Page Links


Special Pages


Wikis

?

Render Time: 42ms

DB GetPage 3
Generate Html 8
SaveChanges (1) 16
Render Body 0
Render Sidebar 12