SetActorHealth
Sets an actor’s health; 0 kills it.
Clamped to 0 .. 100; 0 kills it now (OnActorDeath with attacker -1). Refused on a dead actor - a corpse stays a
corpse; DestroyEntity and CreateActor again.
Syntax
Section titled “Syntax”SetActorHealth(id, health)| Parameter | Type | |
|---|---|---|
id |
number | the actor |
health |
number | the new health |
Returns
Section titled “Returns”boolean - false for a dead actor or anything but an actor
Example
Section titled “Example”SetActorHealth(id, 100) -- patched upSetActorHealth(id, 0) -- executedSee also
Section titled “See also”GetActorHealth · IsActorDead · OnActorDeath · the NPC actors group of the index
