Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Target Practice (https://forums.graalonline.com/forums/showthread.php?t=3261)

JinZero 05-20-2001 09:19 PM

Target Practice
 
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 10:16 PM

Hope this can be useful...
NPC Code:
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 03: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?


All times are GMT +2. The time now is 05:08 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.