Skip to content

Set Exit Command

map.setExitCommand(roomId: number, dir: string, cmd: string)

Sets the exit command for a specific direction

ParamTypeDescription
roomIdnumberID of the exit source room
dirstringDirection (full or abbreviated)
cmdstringCommand(s) to execute in place of direction dir

Example

js
// execute a command to open a door before moving north
map.setExitCommand(100, "north", "open door;north");