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.
Syntax
Section titled “Syntax”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) |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”SetDoorState(GATE, true, false) -- the gate opens for the roundSetTimer(function() SetDoorState(GATE, false, true) end, 30000)-- a rented flat's own door, locked in its copy of the house aloneSetDoorState(FLAT_DOOR, false, true, flat.world)See also
Section titled “See also”GetDoorState · OnPlayerUseDoor · SetVirtualWorldOwnDoors · the Doors and containers group of the index
