How can i make a TextLabel display a random number?

How can i make a TextLabel display an random number?

I want a TextLabel to display an random number.
How can i do that?

2 Likes
textLabel.Text = Random.new():NextInteger(1, 100)
7 Likes

script.Parent.Text = math.Random(Number1, Number2)

1 Like

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().

2 Likes
script.Parent.Text = math.Random(1,10)

Simple as that. 1, 10 is the range.

1 Like