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

I honestly have no idea, what does Random.new() do?

Asked by 4 years ago

I have no idea what the Random.new() constructor does. For me, all it did was return 'Random'.

1 answer

Log in to vote
2
Answered by 4 years ago
Edited 4 years ago

the constructor is a seed. Basically, the seed determines what the random number will be. for example, if you did Random:NextInteger(1,10) the random number that will be printed depends on the seed. If the seed was 58482, it might print 2. But if the seed was 948193, it could print 8.

its kind of like minecraft. if the seed was 94829184928, you could spawn in a snow biome. the seed dictates the number

so by creating a new Random, you pass a seed into the constructor that will give it its “randomness”

0
I tried entering random numbers but all it returned for me was 'Random'. deeskaalstickman649 475 — 4y
Ad

Answer this question