Re-assigning a variable

I have a variable (num) which is equal to (math.random(1,1000)). Let’s say I want to be able to “roll” and make it change numbers with another (math.random(1,1000)) without making numerous variables?

you just do the same thing, ie. num = math.random(1,1000) and it will overwrite num with the new value.

Oh my, I knew that too! Thank you

That’s why they call it a “variable” :slight_smile:

Alright now I’m having another problem, I do this. But of course it’s still true so the number is constantly changing. I can’t really explain it, but my code it

num=math.random(1,1000)

If play==true then --this is enabled by a current touch, and when you tap somewhere else it stops changing nunbers
num=math.random(1,1000)
end

I forget how to write code. I thought it was —

[code]
Testing=0

[code]

Wallisch_pls use three tidles (~~~) before the start and after the end of the code to wrap it in highlighted syntax