Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectServer APIGenerated

Doors

const Doors: object

Defined in: server/api.d.ts:3714

Server-held door state. Every client applies it on arrival and again whenever a matching door streams in, whatever that player’s save says; a key or Alohomora on a held-locked door is refused and raises doorUnlockRequest.

allowUnlock(player, selector): boolean

Lets one player open the lock held under a selector with their game’s own key or Alohomora: the wand cast and the lockpicking minigame play out, and a press it refused moments ago is pressed again for them. Once they open it the server releases that lock for everyone, as Doors.set(selector, { locked: false }) does, and doorUnlocked fires with shared true; abandoned, the door stays locked. Lasts 60 seconds or until used. False when the selector holds no lock or the player is not connected.

Player

string

boolean

clear(selector): boolean

Releases one selector. Its doors keep their current state until they restream into each player’s own save.

string

boolean

clearAll(): number

Releases every selector; returns how many were held.

number

get(selector): DoorState | null

The state held under one selector.

string

DoorState | null

getShareUnlocks(): boolean

Whether locks players open are shared with everyone.

boolean

list(): DoorState[]

Every held door state.

DoorState[]

set(selector, state): boolean

Holds a door’s lock, open state and/or lock level for every player. The selector is an actor name, a persistent id ‘:’ (Doors.list on a client shows both), or an asset path. A selector left holding nothing is released.

string

DoorStateUpdate

boolean

setShareUnlocks(share): void

Whether a lock a player opens by key or Alohomora is held unlocked for everyone, under the door’s persistent id (the default), or stays open only in their game. doorUnlocked fires either way.

boolean

void