Skip to content

SetDoorState

Opens, closes, locks or unlocks a door on every client - or in one virtual world’s own doors.

Without world, or for a world that shares the doors of world 0 (every world does by default), the door changes for everyone and is saved with the level. For a world given doors of its own (SetVirtualWorldOwnDoors) it changes in that world alone, for its players alone.

SetDoorState(key, open, locked [, world])
Parameter Type
key string the door’s level name
open boolean open
locked boolean locked
world number the virtual world whose doors to set; 0 (the default) = the shared ones (optional)

nothing

SetDoorState(GATE, true, false) -- the gate opens for the round
SetTimer(function() SetDoorState(GATE, false, true) end, 30000)
-- a rented flat's own door, locked in its copy of the house alone
SetDoorState(FLAT_DOOR, false, true, flat.world)

GetDoorState · OnPlayerUseDoor · SetVirtualWorldOwnDoors · the Doors and containers group of the index