View Single Post
  #2  
Old 03-24-2001, 08:37 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Blah:
NPC Code:
if (created||timeout) {
if (this.active==1) {
//movement script
if (keydown(0)) {
y-=0.5;
dir = 0;
}
if (keydown(1)) {
x-=0.5;
dir = 1;
}
if (keydown(2)) {
y+=0.5;
dir = 2;
}
if (keydown(3)) {
x+=0.5;
dir = 3;
}
setani whatever,;
freezeplayer 0.05;
}
//Activating or deactivating script.
if (keydown(4)) {
if (this.pressed==0) {
if (this.active==0) this.active=1;
else this.active=0;
this.pressed=1;
}
}
else {
this.pressed=0;
}
timeout = 0.05;
}



But anyways, you need to put in the keydown's in a constantly repeating loop, timeout is the best for that.
__________________

Reply With Quote