Thread: npc script
View Single Post
  #4  
Old 01-26-2002, 08:18 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
hmmm something like:

NPC Code:

if(playertouchsme){
toweapons Soutparkwalking;
}

if(weaponfired){
if(this.active=1){
this.active=0;
enabledefmovement;
}
else {
disabledefmovement;
this.speed = .5; //Can be changed
this.active=1;
timeout=.05;
}
}

if(timeout){
setani sp_walk,;
for(this.i=0;this.i<4;this.i++){
if(keydown(this.i)){
playerdir=this.i;
for(this.m=0;this.m < this.speed;this.m+=.05){
if(!onwall(playerx+1.5+vecx(playerdir)*1.05,player y+2+vecy(playerdir)*1.05)){
playerx+=vecx(playerdir)*.05;
playery+=vecy(playerdir)*.05;
}
}
}
}
if(this.active==1){timeout=.05;}
}




could work, not tested ^_^
__________________
No Webhost at the moment
Reply With Quote