PDA

View Full Version : Target Practice


JinZero
05-20-2001, 10:19 PM
i need a npc like a target, it moves and u have to shoot it with arrow or a fireball, i know this is pretty easy for some of u but not 4 me , how do i script it?

Thak2
05-20-2001, 11:16 PM
Hope this can be useful...
if (playerenters) {
timeout = 0.05;
}
if (playerenters&&isleader) {
i = random(0,2);
if (i<2) {this.mode = 0;}
if (i>1&&i<3) {this.mode = 1;}
timeout = 0.05;
}
if (timeout) {
timeout = 0.05;
}
if (timeout&&this.mode=0) {
x -= 0.2;
timeout = 0.05;
}
if (timeout&&this.mode=1) {
x += 0.2;
timeout = 0.05;
}
if (timeout&&onwall(x,y+1)&&this.mode=0) {
this.mode = 1;
}
if (timeout&&onwall(x+2,y+1)&&this.mode=1) {
this.mode = 0;
}
if (wasshot) {
message BINGO!;
sleep 2;
message ;
timeout = 0.05;
}
Note: this was made for a 32x32 image

JinZero
05-21-2001, 04:35 AM
Thanks, but do u know how i can make the target go a certain length then it'll hide for 5 seconds, and it'll come back at the beginning of where it started moving?