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.
Syntax
Section titled “Syntax”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) |
Returns
Section titled “Returns”boolean, boolean - two booleans open, locked; nil when nobody ever touched the door there (the level’s default)
Example
Section titled “Example”local open, locked = GetDoorState(GATE)if open == nil then Log("the gate is as the level left it") endif GetDoorState(FLAT_DOOR, flat.world) then Log("someone used the door of flat " .. flat.id) endSee also
Section titled “See also”SetDoorState · GetDoors · OnPlayerUseDoor · SetVirtualWorldOwnDoors · the Doors and containers group of the index
