Ok so this is what I'm trying to accomplish with the player coordinate checks.
Its a ladder and I'm using a custom movement system. I need to place an enable and disable custom movement but I haven't yet.
This script seems to work fine if I come top down, but if I start at the bottom it doesn't work at all.
Any help is appreciated.
PHP Code:
//#CLIENTSIDE
function onTimeout() {
if (player.y in |y-.5,y+3|)
Movement.ReplaceAni("climbidle","idle");
Movement.ReplaceAni("climb","walk");
this.ladder = false;
}
function onPlayerTouchsme() {
if (player.y in |y-.5,y+3|) {
this.ladder = false;}
else {
player.dir = 0;
this.ladder = true;
setTimer(0.1);
Movement.ReplaceAni("idle","climbidle");
Movement.ReplaceAni("walk","climb");
}
}
function onKeyPressed(code,key) {
if (this.ladder) {
player.dir = 0;
if (keydown(2)) {
player.y+=0.3;
freezeplayer(.7);
} else if (keydown(0)) {
player.y-=0.15;
freezeplayer(.4);
} else if (keydown(1)) {
player.dir = 0;
return;
} else if (keydown(3)) {
player.dir = 0;
return;
}
}
}