Skip to content

Set Exit

map.setExit(roomId, destRoomId, dir, createReverse = true)

Creates or updates an exit from room roomId to room destRoomId using the specified direction. If the exit already exists, it is updated.

ParamTypeDescription
roomIdnumberID of the exit source room
destRoomIdnumberID of the exit destination room
dirstringDirection (full or abbreviated)
createReverseboolean(Optional) When true, will create an exit in reverse from dest to source.

Example

js
const roomId = 1029;
const label = "pub";
// create north exit from 100 to 110
// and a south exit from 110 to 100
map.setExit(100, 110, "north");