Door
constDoor:object
Defined in: server/api.d.ts:1754
Controls native world doors (building, shop and apartment doors) by door id: their synchronized open and lock state, and whether players can interact with them. A door id is the door’s baked frame hash as a “0x”-prefixed hex string; getCatalog lists every base-game door with its id, and the doorInteract event reports it whenever a player uses a door.
Type Declaration
Section titled “Type Declaration”getCatalog()
Section titled “getCatalog()”getCatalog():
DoorInfo[]
Lists every door of the base game: building, shop and apartment doors, gates, and also cabinets, fridges and windows, which the game builds the same way.
Returns
Section titled “Returns”DoorInfo[]
Every catalogued door.
getDefaultInteractionEnabled()
Section titled “getDefaultInteractionEnabled()”getDefaultInteractionEnabled():
boolean|null
Returns the server-wide door interaction default.
Returns
Section titled “Returns”boolean | null
True or false when forced, null when doors are left as the game sets them up.
getInteractionEnabled()
Section titled “getInteractionEnabled()”getInteractionEnabled(
doorId):boolean|null
Returns a door’s own interaction override.
Parameters
Section titled “Parameters”doorId
Section titled “doorId”string
Door id, a “0x”-prefixed hex string as reported by doorInteract.
Returns
Section titled “Returns”boolean | null
True or false when the door is overridden, null when it follows the server-wide default.
getState()
Section titled “getState()”getState(
doorId):DoorState
Returns the synchronized state of a door. A door nobody touched reads closed and unlocked.
Parameters
Section titled “Parameters”doorId
Section titled “doorId”string
Door id, a “0x”-prefixed hex string as reported by doorInteract.
Returns
Section titled “Returns”The door’s synchronized state.
reset()
Section titled “reset()”reset(
doorId):void
Drops every override on a door: the door closes and unlocks, and its interaction follows the server-wide default again.
Parameters
Section titled “Parameters”doorId
Section titled “doorId”string
Door id, a “0x”-prefixed hex string as reported by doorInteract.
Returns
Section titled “Returns”void
setDefaultInteractionEnabled()
Section titled “setDefaultInteractionEnabled()”setDefaultInteractionEnabled(
enabled):void
Sets the server-wide interaction default for every door without its own override.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean | null
True to enable every door, false to disable every door, null to leave each door as the game sets it up.
Returns
Section titled “Returns”void
setInteractionEnabled()
Section titled “setInteractionEnabled()”setInteractionEnabled(
doorId,enabled):boolean
Overrides whether players can open, kick, lock or lockpick a door. A door with interaction disabled still follows setState.
Parameters
Section titled “Parameters”doorId
Section titled “doorId”string
Door id, a “0x”-prefixed hex string as reported by doorInteract.
enabled
Section titled “enabled”boolean | null
True to let players use the door, including doors the game’s own scripts keep disabled; false to remove its prompt; null to follow the server-wide default.
Returns
Section titled “Returns”boolean
False when the door registry is full.
setState()
Section titled “setState()”setState(
doorId,open,locked?):boolean
Forces a door open or closed, locked or unlocked, for every player, including players who stream it in later.
Parameters
Section titled “Parameters”doorId
Section titled “doorId”string
Door id, a “0x”-prefixed hex string as reported by doorInteract.
boolean
True to swing the door open, false to close it.
locked?
Section titled “locked?”boolean
Lock state; keeps the current lock state when omitted.
Returns
Section titled “Returns”boolean
False when the door registry is full (256 doors that differ from their default).
