Blockland Forums > Modification Help

How to make a Delayed FOR loop?

Pages: (1/1)

Ipquarx:

In a script im making, I need to make a for loop that waits a specified ammount of time before continuing on to the next segment of the for loop, without needing to use outside functions. this is all inside 1 for loop.
this is what i've tryed:

--- Code: ---for(%i = 0; %i < %loops; %i++)
{
%ans[%i] = %loops / %i;
schedule(%delay, 0, "Continue");
}
--- End code ---
But it doesnt work.
How can I make this work?

otto-san:

http://forum.blockland.us/index.php?topic=26457.0

Alternatively, you can have a schedule multiplied by %i to make it seem like there was a delay in the loop.

ie 60*%i

Kalphiter:


--- Quote from: otto-san on October 16, 2011, 01:41:42 PM ---Alternatively, you can have a schedule multiplied by %i to make it seem like there was a delay in the loop.

ie 60*%i

--- End quote ---
And by doing that nothing else in the engine can happen meaning it will lag.

otto-san:


--- Quote from: Kalphiter on October 16, 2011, 01:55:13 PM ---And by doing that nothing else in the engine can happen meaning it will lag.

--- End quote ---
hm.


Never thought of it that way.

Chrono:

You can't make that work.

You need to use a scheduled function loop to make delays.

Pages: (1/1)

Go to full version