Skip to content

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.

function OnPlayerBlockedByActor(pid, id)
-- ...
end
Parameter Type
pid number the player who swung
id number the actor

nothing

function OnPlayerBlockedByActor(pid, id)
SetPlayerStamina(pid, GetPlayerStamina(pid) - 5) -- a blow into a guard jars the arm
end

OnActorBlocked · OnActorDamage · the NPC actors group of the index