try to use math.randomseed()
at the start of your script and put some number in the () for example:
math.randomseed(12345)
while task.wait(1) do
local randomNumber = math.random(1,10)
print(randomNumber)
end
then, if you rerun the game, you will get the same numbers.