NPC Code:
if(playerchats){
if(strequals(#c,open doors)
opendoor();
elseif(strequals(#c,close doors)
closedoor();
}
function opendoor(){
for (this.moved=0;this.moved<5;this.moved++)
x--;
}
function closedoor(){
for (this.moved=0;this.moved<5;this.moved++)
x++;
}
well I guess it would probably make it a shorter code if I would have took what is in the functions and like put it in were it calls it but oh well to lazy to do that now (I am pretty sure htis iwll work for an npc server)..
this will make the npc move back and forth 5 tiles (left and right)