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
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