OnPlayerBlockedByActor
A player’s swing met an actor’s raised guard.
An armed actor raises its guard against a swing part of the time ([actors] block_chance); this fires when the player’s blow
met it and did no harm. Once per swing. A blow that glanced off without a guard comes to neither this nor OnActorDamage.
Syntax
Section titled “Syntax”function OnPlayerBlockedByActor(pid, id) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player who swung |
id |
number | the actor |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnPlayerBlockedByActor(pid, id) SetPlayerStamina(pid, GetPlayerStamina(pid) - 5) -- a blow into a guard jars the armendSee also
Section titled “See also”OnActorBlocked · OnActorDamage · the NPC actors group of the index
