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

Any way to give a time for math.random choose a number again?

Is there any way for give a time for math.random choose same number again? if print 1, then 1 can be choosen again in 10 seconds for example.

local numbers = {1,2,3,4,5,6,7,8,9,10}
local randomTrack = numbers[math.random(1,#numbers)]	
if randomTrack ==1 then
print("1")
end
if randomTrack ==2 then
print("2")
end
if randomTrack ==3 then
print("3")
end
end

1 answer

Here is a way. Its a bit more simple. Hope you dont mind!

while wait(2) do
	local randomTrack = math.random(1,10)
	print(randomTrack)
end

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