I wanna know how to make a random number generator between 0 and 9999. Not PRINT text, but on a textlabel. And i want it to have the text Guest before it.
You could use math.random.
"This function is an interface to the simple pseudo-random generator function rand provided by ANSI C. (No guarantees can be given for its statistical properties.) When called without arguments, returns a uniform pseudo-random real number in the range [0,1). When called with an integer number m, math.random returns a uniform pseudo-random integer in the range [1, m]. When called with two integer numbers m and n, math.random returns a uniform pseudo-random integer in the range [m, n]."
Example code:
local random = math.random(1,9999) -- random number 1-9999 print(random) -- the random number
Heres your answer!
local num = math.random(1,99999) -- put the two numbers you want generated if num = 1 then script.Parent.Text = guest elseif num = 2 then script.Parent.Text = guest else -- All of the other excluded numbers that you most likely will not want in your script. -- Content here as well end
but I wanna know how to make a random number generator ((BETWEEN))) 0 and 9999. Not PRINT text, but on a textlabel. And i want it to have the text ((Guest)) before it.
local Number = math.random(1,9999) -- Assuming there's a textlabel in workspace called "TextLabel" workspace.TextLabel.Text = "Guest " .. tostring(Number)
Closed as Not Constructive by raid6n, botw_legend, and EzraNehemiah_TF2
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?