Garry's Mod Wiki

Player:TraceHullAttack

Entity Player:TraceHullAttack( Vector startPos, Vector endPos, Vector mins, Vector maxs, number damage, Vector damageFlags, number damageForce, boolean damageAllNPCs )

Description

Performs a trace hull and applies damage to the entities hit, returns the first entity hit.

Hitting the victim entity with this function in ENTITY:OnTakeDamage can cause infinite loops.

Arguments

1 Vector startPos
The start position of the hull trace.
2 Vector endPos
The end position of the hull trace.
3 Vector mins
The minimum coordinates of the hull.
4 Vector maxs
The maximum coordinates of the hull.
5 number damage
The damage to be applied.
6 Vector damageFlags
Bitflag specifying the damage type, see Enums/DMG.
7 number damageForce
The force to be applied to the hit object.
8 boolean damageAllNPCs
Whether to apply damage to all hit NPCs or not.

Returns

1 Entity
The hit entity

Page Links


Special Pages


Wikis

?

Render Time: 50ms

DB GetPage 4
Generate Html 23
SaveChanges 9
Render Body 0
Render Sidebar 12