Thread: Slideing door
View Single Post
  #2  
Old 08-29-2001, 04:08 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
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)
__________________
Thanks,
-KJL
Reply With Quote