jadis:
of course that script was written in 1.1 so it is insanely complicated. and I don't mean this one down here, I mean the one that was made by Bruges.
NPC Code:
if (playerenters||timeout) {
this.speed = .2;
timeout = .05;
if (playerdir<3) playerdir++;
else playerdir = 0;
if (abs(playerx-x)<=this.speed&&abs(playery-y)<=this.speed) {
playerx = x;
playery = y;
}
if (playery>y&&!onwall(playerx+.5,playery+1)&&!onwall (playerx+1,playery+1)&&!onwall(playerx+1.5,playery +1)) playery-=this.speed;
if (playery<y&&!onwall(playerx+.5,playery+3)&&!onwall (playerx+1,playery+3)&&!onwall(playerx+1.5,playery +3)) playery+=this.speed;
if (playerx<x&&!onwall(playerx+2.5,playery+1)&&!onwal l(playerx+2.5,playery+2)) playerx+=this.speed;
if (playerx>x&&!onwall(playerx-.5,playery+1)&&!onwall(playerx-.5,playery+2)) playerx-=this.speed;
}