What's new

Solved Generate random number

Status
Not open for further replies.
R1ch4rd

R1ch4rd

Like a baaaws
Messages
396
Reaction score
62
Points
85
Sin$
0
I want to generate a random number ranging from 0 - 9, and set i as the result, but I don't know how to do it. Please help!
 
R1ch4rd

R1ch4rd

Like a baaaws
Messages
396
Reaction score
62
Points
85
Sin$
0
OK then, I'll rephrase it a bit. I want to know the code that I have to put into my patch_mp.ff to generate a random number ranging from 1 - 9, and then have it set as i.
 
Upvote 0
renegade770

renegade770

Enthusiast
Messages
1,336
Reaction score
172
Points
165
Sin$
0
i = randomInt(5);
generates number between 0-4
at least i think that should work. i just kinda stole it from killndyl's zombies. he uses it to give random weapons.
 
Upvote 0
BigWalrus

BigWalrus

Enthusiast
Messages
1,991
Reaction score
885
Points
175
Sin$
0
i = randomInt(5);
generates number between 0-4
at least i think that should work. i just kinda stole it from killndyl's zombies. he uses it to give random weapons.
yes that is exactly how it works.
 
Upvote 0
Status
Not open for further replies.
Top Bottom
Login
Register