Garry's Mod Wiki

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

Page Links


Special Pages


Wikis

?

Render Time: 80ms

DB GetPage 42
Generate Html 13
SaveChanges (1) 9
Render Body 0
Render Sidebar 12