Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

math.randomseed only returns nil?

I ran this:

print(math.randomseed(5))	

It output a blank space, which is a nil value. This is preventing me from doing math.randomseed(tick()). Help?

1 answer

math.randomseed(tick()) is just done to change the seed of the (pseudo)random number generator. What you're looking for is math.random:

math.randomseed(tick());

local randomNumberBetweenOneAndFive = math.random(5);

Read more about random numbers.

Hope this helped.

This discussion is preserved as it was. New answers, comments, and votes are closed.