Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 15,207 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
wait() variable #223630
08/25/08 14:03
08/25/08 14:03
Joined: Aug 2008
Posts: 25
B
bluemax Offline OP
Newbie
bluemax  Offline OP
Newbie
B

Joined: Aug 2008
Posts: 25
I'm trying to have my code wait a random amount of time. Why doesn't the code work when I put a variable in the wait prenthesis?

For example:
//
var x = 0;

x = random(5)*-1;

wait(x);
//

Re: wait() variable [Re: bluemax] #223642
08/25/08 15:47
08/25/08 15:47
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
try
Code:
random_seed(0);
x = integer(random(5)+1); //between 1 and 5
wait(x);
bear in mind tho this is only waiting between 1 and 5 frames, you won't see the difference

for seconds use
Code:
x = integer(random(5)+1) * -1;



Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1