This causes the last created ladder to unattach the player all the time since he/she isnt close to the ladder.
PHP Code:
if (player.x in |x-1,x+1| && player.y in |y-.5,y+8|) {
if (player.attached==false) attachplayertoobj(0,id);
// do stuff
} else detachplayer();
Change to:
PHP Code:
if (player.x in |x-1,x+1| && player.y in |y-.5,y+8|) {
if (player.attached==false) attachplayertoobj(0,id);
// do stuff
} else if (player.attached == true) detachplayer();