Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Math Random Help?

Asked by 10 years ago

here's my script:

math.random(1,300)

So the 1,300 means that every 300 studs there will be one of the topic, right?

thanks.

1 answer

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

'one of the topic', What?? I don't know what you mean by that but math.random takes two arguments, the first one is the minimal number and the second is the maximum number. math.random chooses a random number in the scope of these arguments

math.random(1,2) --1 or 2
math.random(1,3) --1, 2, or 3
math.random(1,4) --1, 2, 3, or 4
--You get the idea--

math.random(3,962) --Number between 3 and 962.

--So...
math.random(1,300) --A random number between 1 and 300
0
thanks! :)D JustGimmeDaBux 18 — 10y
Ad

Answer this question