View Single Post
  #5  
Old 07-29-2003, 04:46 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
NPC Code:

if(created||timeout){
if(this.dir=0&&y>0) y-=0.5;
if(this.dir=2&&x>0) y+=0.5;
if(this.dir=1&&x<64) x-=0.5;
if(this.dir=3&&y<64) x+=0.5;
message #v(this.dir);
timeout=0.5;
}

if(actionmove){
this.dir=strtofloat(#p(0));
timeout=0.5;
}

//#CLIENTSIDE
//Fixed by *osrs

if(created){
setimg block.png;
this.max=4;
timeout=0.05;
}

if(timeout||playerenters){
for(k=0;k<this.max;k++){
if(keydown(k)&&k!=this.m){
triggeraction x,y,move,#v(k);
this.m=strtofloat(#v(k));
}
}
timeout=0.05;
}



I think there is no need to trigger the npc every time when the position is changed,i tested the script online and worked fine.

PS:It's not the whole code,Kai
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote