How can i make a TextLabel display an random number?
I want a TextLabel to display an random number.
How can i do that?
I want a TextLabel to display an random number.
How can i do that?
textLabel.Text = Random.new():NextInteger(1, 100)
script.Parent.Text = math.Random(Number1, Number2)
It is generally recommended not to use math.random
, because it uses a global seed that is often not-so-random when other scripts use math.randomseed
. It still works, but you need to be extra careful if it’s for something serious like random loot, or if your game has any scripts that call math.randomseed()
.
script.Parent.Text = math.Random(1,10)
Simple as that. 1, 10 is the range.