OnPlayerInjury
A hit injured one of the player’s body parts.
A hit of at least [combat] injury_threshold injures the part it struck. An injured arm makes the player’s swings weaker
and costlier; an injured head or torso halves the stamina regeneration. HealPlayer and the respawn heal it.
Syntax
Section titled “Syntax”function OnPlayerInjury(pid, attacker, part) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the victim |
attacker |
number | who struck; -1 = nobody |
part |
number | the body part, 1 .. 6 |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnPlayerInjury(pid, attacker, part) SendClientMessage(pid, COLOUR_RED, "your " .. GetBodyPartName(part):gsub("_", " ") .. " is injured")endSee also
Section titled “See also”OnPlayerDamage · GetPlayerInjuries · GetBodyPartName · the Combat group of the index
