I have tried, have read through tutorials but it does not work, what happens is that instead of pressing left or right to change the menu u have to press escape , do u know how i could fix this, my main script is:
EvaluateScript("Menu.js");
function game() {
MainMenu();
}
function menu() {
var MyMenu = new Menu();
MyMenu.addItem("Pokemon", Pokemon);
MyMenu.addItem("Bag", Bag);
MyMenu.addItem("Exit", Exit);
MyMenu.execute(1, 1, 100, 200);
}
function Pokemon() {
Abort("You choose Pokemon\n");
}
function Bag() {
var MyMenu =new menu();
MyMenu.execute(1, 1, 100, 200);
if (IsKeyPressed(KEY_LEFT) == false)
var MyMenu =new menu();
BindKey(KEY_ESCAPE, "menu()","");
MyMenu.addItem("Bag", Bag);
MyMenu.execute(1, 1, 100, 200);
if (IsKeyPressed(KEY_RIGHT) == false)
var MyMenu =new menu();
MyMenu.addItem("Exit", Exit);
MyMenu.execute(1, 1, 100, 200);
}
function WarpObject(x, y, layer, map) {
if (this instanceof WarpObject == false) {
return new WarpObject(x, y, layer, map);
}
this.x = x;
this.y = y;
this.layer = layer;
this.map = map;
}
WarpObject.prototype.warp_to = function() {
if (IsInputAttached()) {
var person = GetInputPerson();
if (typeof(this.map) == typeof("string")) ChangeMap(this.map);
if (typeof(this.layer) == typeof(0) && this.layer >= 0) SetPersonLayer(person, this.layer);
if (typeof(this.x) == typeof(0)) SetPersonX(person, this.x);
if (typeof(this.y) == typeof(0)) SetPersonY(person, this.y);
}
}
var town_door_1 = WarpObject(120, 64, 0, "map1.rmp");
var house_1 = WarpObject(60, 60, 0, "map1.rmp");