Thanks to ziro, its fixed =)
Script ladder updated by xXziroXx (x12 or so)
Ladder Solution Guy: Fixed.
DND: oO how?
Ladder Solution Guy: if (player.x in |x-1,x+1| && player.y in |y-.5,y+8|) { ... } else detachplayer();
Ladder Solution Guy: changed to
Ladder Solution Guy: if (player.x in |x-1,x+1| && player.y in |y-.5,y+8|) { ... } else if (player.attached == true) detachplayer();
Ladder Solution Guy: since other wise the last created ladded will unattach the player since he/she isnt close to the ladded
Ladder Solution Guy: ladder*
and for those that just want to look at the fixed version:
PHP Code:
// 2x8 ladder
//setshape=2,12
//in=-.5,8
function onCreated() {
setshape(1,2*16,12*16);
}
function onActionRemove() {
destroy();
}
//#CLIENTSIDE
function onCreated() {
message("Don't touch, m'kay? ("@id@")");
setimg("");
setshape2(2,12,{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,});
setTimer(.05);
}
function onPlayerchats() {
if (player.chat=="removeladders") {
this.acctlist={"calani","jerret"};
for(this.i=0;this.i<this.acctlist.size();this.i++) {
if (player.account==this.acctlist[this.i]) {
message("removing...");
level.ladderscount=1;
triggeraction(x+1,y+1,"Remove",NULL);
}
}
} elseif (player.chat=="detach") {
detachplayer();
player.x=x+1.5;
player.y=y-1.5;
}
}
function onTimeout() {
showimg(1,"zodiac_ladder.png",x,y+2);
findimg(1).layer=0;
blockagain();
if (player.x in |x-1,x+1| && player.y in |y-.5,y+8|) {
if (player.attached==false) attachplayertoobj(0,id);
player.y+=.3; // shoot!
// do stuff
} else if (player.attached == true) detachplayer();
message(player.attached);
setTimer(.1);
}
Drat, you beat me to it!