Graal Forums

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

zell12 08-03-2001 12:34 AM

NPC Question
 
I want to know how to make a script repeat itself...

i never ever knew how.....lol

ownerofbabylon 08-03-2001 12:35 AM

make it loop LOL

either use a for loop or a do loop or any other ones

zell12 08-03-2001 12:36 AM

what is the script for the loop... there isn't anything in the commands

zokemon 08-03-2001 12:39 AM

Quote:

Originally posted by zell12
what is the script for the loop... there isn't anything in the commands
OMFG!!!!
DUH!
its:
while () {
sleep 0.05;
}

ownerofbabylon 08-03-2001 12:40 AM

actually do a timeout. it is the easiest. that way it does somthing everytime it times out ^_^

set the timeout to 1
then do the script and make it do the script everytime it timesout to 1. That would make it happen ever second.

zell12 08-03-2001 12:53 AM

ok, i used that before, i just didn't do it right, but before that, wouldn't you use

timerteverywhere;

LiquidIce00 08-03-2001 01:00 AM

depends..
if you are going to make something that keeps on acting while the player can do something else then make a timeout..
if it is just a code that needs to be runned once or when you fire the weapon or ''checks'' then do either a while or a for loop..

Brent5000 08-03-2001 11:07 AM

Errr the script for timeouts is just like

if (weaponfired) {timeout = 1;}
if (timeout) {blah blah....blah blah....;}

SkooL 08-03-2001 11:22 AM

Quote:

Originally posted by Brent5000
Errr the script for timeouts is just like

if (weaponfired) {timeout = 1;}
if (timeout) {blah blah....blah blah....;}

You'd have to add another timeout at the end of the "blah blah....blah balh....;". ;)


All times are GMT +2. The time now is 04:13 AM.

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