Garry's Mod Wiki

Garry's Mod Wiki

  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 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.

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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...