#Math.Random Picks another number again

3 messages · Page 1 of 1 (latest)

tacit bloom
#

how can i make a math.random pick a random number again if it picks a certain number?
example:

local Robbery = math.Random(1,2)

if Robbery == 1 then
--some function
elseif Robbery == 2 then
--wait(30), and pick a math.random again,
end

but how would i make it do the same function again?

(sorry if it didnt made any sense, im in a rush rn)

dapper grove
#

I think you could just do;

local Robbery = math.Random(1,2)

if Robbery == 1 then
--some function
elseif Robbery == 2 then
wait(30)
Robbery = math.Random(2)
end
#

So it makes the variable "Robbery" into another random number