Garry's Mod Wiki

Entity:DispatchTraceAttack

  Entity:DispatchTraceAttack( CTakeDamageInfo damageInfo, table traceRes, Vector dir = traceRes.HitNormal )

Description

Performs a trace attack towards the entity this function is called on. Visually identical to Entity:TakeDamageInfo.

Calling this function on the victim entity in ENTITY:OnTakeDamage can cause infinite loops.

Arguments

1 CTakeDamageInfo damageInfo
The damage to apply.
2 table traceRes
Trace result to use to deal damage. See Structures/TraceResult
3 Vector dir = traceRes.HitNormal
Direction of the attack.