Garry's Mod Wiki

GM:PlayerHurt

GM:PlayerHurt

  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

Special Pages


Wikis

?

Render Time: 428ms

DB GetPage 48
Generate Html 4
SaveChanges (1) 367
Render Body 0
Render Sidebar 7