Skip to content

SetActorInvisibleFor

Hides an actor from one player, or shows it to one player while it is invisible to the rest.

One player’s own rule for the actor, which wins over SetActorInvisible both ways: false lets this player see an invisible actor, true hides a visible actor from this player alone, nil drops the rule. What a hidden actor hides is the same as SetActorInvisible’s. The rule is forgotten when the player leaves, and by a reload of the mode.

SetActorInvisibleFor(id, viewer, invisible)
Parameter Type
id number the actor or animal
viewer number the player whose screen the rule is for
invisible boolean|nil true hides the actor from viewer, false shows it, nil follows SetActorInvisible again

boolean - false for anything but an actor or an animal, or when the viewer is not connected

-- a quest's informant only the player on the quest can see
SetActorInvisible(informant, true)
SetActorInvisibleFor(informant, pid, false)

SetActorInvisible · IsActorVisibleTo · the NPC actors group of the index