NPC Help

Hello,
i wanna move the coordinate of an NPC, but i don’t know how, help.
like the x and y of the NPC on the level

I know this seems silly, but can’t you just move it? Or else you can open up the script and type in it’s x and y value:

[php]if (playerenters) {
x=32;
y=32;
}[/php]

Could always try clickin’ and draggin’.

I was hoping this was gunna be a good question to answer :C

Use timeout and if(timeout)… in this fashion:

if(playerenters){
timeout = 0.05;
}
if(timeout){
x+=.5;
timeout = 0.05;
}

I guess that’s what he meant… I took a long time figuring that one out when I was a kid.

A better solution is to use move rather than a scripted timeout loop.

this.moveX = 2;//distance you want to move either left or right
this.moveY = 4;//distance you want to move either up or down
this.speed = 0.6;
  this.dist = (this.movex^2+this.movey^2)^0.5;
  this.time = this.dist/(this.speed*20);//simple speed = distance/time equation
  this.options = 16 + 4;//apply dir + block check

move this.moveX,this.moveY,this.time,this.options;

More move options can be seen here: