sweetgum83/scripts/portal/elevator.js
2024-01-19 03:56:28 -05:00

19 lines
830 B
JavaScript

function enter(pi) {
try {
var elevator = pi.getEventManager("Elevator");
if (elevator == null) {
pi.getPlayer().dropMessage(5, "The elevator is under maintenance.");
} else if (elevator.getProperty(pi.getMapId() == 222020100 ? ("goingUp") : ("goingDown")) === "false") {
pi.playPortalSound();
pi.warp(pi.getMapId() == 222020100 ? 222020110 : 222020210, 0);
return true;
} else if (elevator.getProperty(pi.getMapId() == 222020100 ? ("goingUp") : ("goingDown")) === "true") {
pi.getPlayer().dropMessage(5, "The elevator is currently moving.");
} else {
pi.getPlayer().dropMessage(5, "Dafuq is happening?!");
}
} catch (e) {
pi.getPlayer().dropMessage(5, "Error: " + e);
}
return false;
}