I want something like.
local hi = math.random(1,2) if hi == 1 then re does the math.random(1,2) until hi == 2
You'll want to use loops basically
local hi = math.random(1,2) while hi ~= 2 do -- while hi is not equal to 2 loop wait() hi = math.random(1,2) end
that will work if you only want 2 choices if you want more something like this will work
local taken = {} -- store all the used values local hi = math.random(1,5) -- final unused value local foundOne = false -- keep while loop going while foundOne == false do wait() foundOne = true -- make true since it assumes it's not taken until proven wrong local hi = math.random(1,5) -- change hi to new value for i = 1,#taken do -- loop through all used values if taken[i] == hi then -- value is taken foundOne = false -- continue loop end end end table.insert(taken,hi) -- add value to used list