Garry's Mod Wiki

Garry's Mod Wiki

  GM:PlayerHurt( Player victim, Entity attacker, number healthRemaining, number damageTaken )

Description

Called when a player gets hurt.

Arguments

1 Player victim
Victim
2 Entity attacker
Attacker Entity
3 number healthRemaining
Remaining Health
4 number damageTaken
Damage Taken

Example

Show players attacker in Chat.

function GM:PlayerHurt(victim, attacker) if ( attacker:IsPlayer() ) then victim:ChatPrint("You were attacked by : " .. attacker:Nick()) end 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 twice a day. Edits and history are not available.

Last Parsed: Loading...