I'm trying to choose a random number from 1-3. It only ever outputs 2.
math.randomseed(tick())
local decal = math.random(3)
I'm trying to choose a random number from 1-3. It only ever outputs 2.
math.randomseed(tick())
local decal = math.random(3)
To program a random number from 1 to 3, first we must set a variable to this number. Let's call this variable RandomNumber.
This is all you have to do.
RandomNumber = math.random(1,3)
If you want it to choose a number from let's say, 3 to 7, then you would declare:
RandomNumber = math.random(3,7)
This will set RandomNumber to a random value from 1 to 3. (Or at least the first line will)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
could be https://scriptinghelpers.org/questions/42029/random-always-picks-last-element-in-table