Skip to content

SetActorInvulnerable

Makes an actor one no blow hurts - or hittable again.

A hit on an invulnerable actor is refused before anything happens: no damage, no wound, no fight of record, no OnActorDamage; it never turns on the attacker. The body still shows the swing land. For a vendor, a quest giver, a guard nobody may kill.

SetActorInvulnerable(id [, invulnerable])
Parameter Type
id number the actor
invulnerable boolean true (the default) = no blow hurts it; false = it takes hits (optional)

boolean - false for anything but an actor

local merchant = CreateActor(nil, x, y, z, 180, "Merchant", nil, "none")
SetActorInvulnerable(merchant, true)

IsActorInvulnerable · OnActorDamage · SetActorHostile · the NPC actors group of the index