Skip to content

SetActorKnockedOut

Knocks an NPC actor out, or wakes it.

The actor drops where it stands for everyone who has its body: its walk stops, its fight ends, its AI stays still while it is down (a vendor knocked out trades with nobody). seconds above 0 wakes it after that long (24 hours at the most); 0 or nil keeps it down until woken (IsActorKnockedOut). A knocked-out actor can be carried by the grab (SetCarrying, the actors rule) and by CarryEntity. Dying ends it. false when actorId is not a living NPC actor.

SetActorKnockedOut(actorId [, on, seconds])
Parameter Type
actorId number the NPC actor
on boolean true (the default) knocks it out, false wakes it (optional)
seconds number how long it stays down, at most 86400 (24 hours); nil or 0 until woken (optional)

boolean

SetActorKnockedOut(guard, true, 30) -- the guard is out for half a minute

IsActorKnockedOut · SetPlayerKnockedOut · CarryEntity · the Carrying group of the index