Skip to content
M2O Scripting APIScripting reference
Global objectServer APIGenerated

Door

const Door: 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.

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.

DoorInfo[]

Every catalogued door.

getDefaultInteractionEnabled(): boolean | null

Returns the server-wide door interaction default.

boolean | null

True or false when forced, null when doors are left as the game sets them up.

getInteractionEnabled(doorId): boolean | null

Returns a door’s own interaction override.

string

Door id, a “0x”-prefixed hex string as reported by doorInteract.

boolean | null

True or false when the door is overridden, null when it follows the server-wide default.

getState(doorId): DoorState

Returns the synchronized state of a door. A door nobody touched reads closed and unlocked.

string

Door id, a “0x”-prefixed hex string as reported by doorInteract.

DoorState

The door’s synchronized state.

reset(doorId): void

Drops every override on a door: the door closes and unlocks, and its interaction follows the server-wide default again.

string

Door id, a “0x”-prefixed hex string as reported by doorInteract.

void

setDefaultInteractionEnabled(enabled): void

Sets the server-wide interaction default for every door without its own override.

boolean | null

True to enable every door, false to disable every door, null to leave each door as the game sets it up.

void

setInteractionEnabled(doorId, enabled): boolean

Overrides whether players can open, kick, lock or lockpick a door. A door with interaction disabled still follows setState.

string

Door id, a “0x”-prefixed hex string as reported by doorInteract.

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.

boolean

False when the door registry is full.

setState(doorId, open, locked?): boolean

Forces a door open or closed, locked or unlocked, for every player, including players who stream it in later.

string

Door id, a “0x”-prefixed hex string as reported by doorInteract.

boolean

True to swing the door open, false to close it.

boolean

Lock state; keeps the current lock state when omitted.

boolean

False when the door registry is full (256 doors that differ from their default).