Garry's Mod Wiki

CTakeDamageInfo:GetInflictor

  Entity CTakeDamageInfo:GetInflictor()

Description

Returns the inflictor of the damage. This is not necessarily a weapon.

For hitscan weapons this is the weapon.

For projectile weapons this is the projectile.

For a more reliable method of getting the weapon that damaged an entity, use GetAttacker with GetActiveWeapon.

Returns

1 Entity
The inflictor