Thread: Soccer script!
View Single Post
  #2  
Old 09-09-2001, 11:04 PM
Enigma_GP6 Enigma_GP6 is offline
Banned
Join Date: Jul 2001
Location: Who?
Posts: 261
Enigma_GP6 is on a distinguished road
Send a message via ICQ to Enigma_GP6 Send a message via AIM to Enigma_GP6
I dunno, try this, it usually works as far as I know, I made this 3 months ago, someone else copied it, and will probably try to take credit for it.:
// NPC made by Rebel95
if (playerenters){timereverywhere;timeout=.05;
drawunderplayer;canbepushed}
if(playertouchsme){
if(playerdir=1){this.x-=1.5;this.y+=(y-playery-1)}
if(playerdir=3){this.x+=1.5;this.y+=(y-playery-1)}
if(playerdir=2){this.y+=1.5;this.x+=(x-playerx-1)}
if(playerdir=0){this.y-=1.5;this.x+=(x-playerx-1)}
this.subx=abs((this.x)/10);
this.suby=abs((this.y)/10);
}
if(timeout){timeout=.05;
if(this.x<>0)}{x+=this.x;
if(this.x>0)this.x-=this.subx;
if(this.x<0)this.x+=this.subx;
if(abs(this.x)<.1)this.x=0;
}
if(this.y<>0){y+=this.y;
if(this.y>0)this.y-=this.suby;
if(this.y<0)this.y+=this.suby;
if(abs(this.y)<.1)this.y=0;
}
if(onwall(x+.5,y-.5)&&this.y<0)this.y=(-this.y);
if(onwall(x+.5,y+1.5)&&this.y>0)this.y=(-this.y);
if(onwall(x+1.5,y+.5)&&this.x>0)this.x=(-this.x);
if(onwall(x-.5,y+.5)&&this.x<0)this.x=(-this.x);


-Rebel95
Reply With Quote