Skip to content

GetDoorState

A door’s state of record - the shared one, or a virtual world’s own.

Every virtual world shares the doors of world 0 unless SetVirtualWorldOwnDoors gave it doors of its own; then world reads that world’s.

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

boolean, boolean - two booleans open, locked; nil when nobody ever touched the door there (the level’s default)

local open, locked = GetDoorState(GATE)
if open == nil then Log("the gate is as the level left it") end
if GetDoorState(FLAT_DOOR, flat.world) then Log("someone used the door of flat " .. flat.id) end

SetDoorState · GetDoors · OnPlayerUseDoor · SetVirtualWorldOwnDoors · the Doors and containers group of the index