Skip to content
M2O Scripting APIScripting reference
Global objectServer APIGenerated

Lift

const Lift: object

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

Controls the game’s lifts by lift id: which floor each one is at, and whether players can use its buttons. A lift id is the lift’s baked frame hash as a “0x”-prefixed hex string; getCatalog lists every base-game lift with its id. The server decides every move: a player’s button press only asks for one, and every player sees the lift travel with the game’s own motion, doors and sounds. Lift state is kept per virtual world: a player only sees and moves the lifts of their own world.

getCatalog(): LiftInfo[]

Lists every lift of the base game.

LiftInfo[]

Every catalogued lift.

getInteractionEnabled(liftId, virtualWorld?): boolean | null

Returns a lift’s button override in a virtual world.

string

Lift id, a “0x”-prefixed hex string as getCatalog lists it.

number

Virtual world whose lift state to use; 0 when omitted.

boolean | null

True or false when overridden, null when the buttons are left as the game sets them up.

getState(liftId, virtualWorld?): LiftState

Returns the synchronized state of a lift in a virtual world. A lift the server has never moved reads as idle at the floor the game starts it at.

string

Lift id, a “0x”-prefixed hex string as getCatalog lists it.

number

Virtual world whose lift state to use; 0 when omitted.

LiftState

The lift’s synchronized state.

reset(liftId, virtualWorld?): void

Hands a lift in a virtual world back to the game: it skips back to the floor the game starts it at, its buttons go back to how the game sets them up, and the server forgets it. No liftArrive is dispatched for the trip back.

string

Lift id, a “0x”-prefixed hex string as getCatalog lists it.

number

Virtual world whose lift state to use; 0 when omitted.

void

setFloor(liftId, floor, instant?, virtualWorld?): boolean

Sends a lift to a floor for every player in the virtual world. Players who stream the lift in later, or join mid-move, see it where the move has got to.

string

Lift id, a “0x”-prefixed hex string as getCatalog lists it.

number

Floor to send the lift to; 0 is the lowest, up to the lift’s floorCount - 1.

boolean

True for the game’s fast travel: the cab accelerates, jumps to just short of the floor with its riders, and brakes. False or omitted to travel the whole shaft.

number

Virtual world whose lift state to use; 0 when omitted.

boolean

True when the lift is on its way or already idle at that floor; false while it is still moving, or for a floor it does not have.

setInteractionEnabled(liftId, enabled, virtualWorld?): boolean

Overrides whether players in a virtual world can use a lift’s buttons. A lift whose buttons are disabled still follows setFloor.

string

Lift id, a “0x”-prefixed hex string as getCatalog lists it.

boolean | null

True to let players use the cab button and the call buttons, false to remove their prompts, null to leave them as the game sets them up.

number

Virtual world whose lift state to use; 0 when omitted.

boolean

False for an unknown lift id, or when the world’s lift registry is full.