Skip to content

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.

SetActorHealth(id, health)
Parameter Type
id number the actor
health number the new health

boolean - false for a dead actor or anything but an actor

SetActorHealth(id, 100) -- patched up
SetActorHealth(id, 0) -- executed

GetActorHealth · IsActorDead · OnActorDeath · the NPC actors group of the index