I'm trying to get 3 different numbers between 1 and 6. I have no idea why it's not working.
math.randomseed(tick())
local num = math.random(1,6)
print(num)
wait(0.5)
math.randomseed(tick())
local numb = math.random(1,6)
print(numb)
wait(0.7)
math.randomseed(tick())
local number = math.random(1,6)
print(number)
while true do
wait()
if number == numb then
wait(1)
math.randomseed(tick())
local numb = math.random(1,6)
elseif number == num then
wait(1)
math.randomseed(tick())
local num = math.random(1,6)
elseif num == numb then
wait(1)
math.randomseed(tick())
local num = math.random(1,6)
else
break
end
end
any ideas, thanks in advance.
math.randomseed(tick())
local num = math.random(1,6)
print(num)
wait(0.5)
math.randomseed(tick())
local numb = math.random(1,6)
print(numb)
wait(0.7)
math.randomseed(tick())
local number = math.random(1,6)
print(number)
while true do
wait()
if number == numb then
wait(1)
math.randomseed(tick())
local numb = math.random(1,6)
print(numb.."numb")
elseif number == num then
wait(1)
math.randomseed(tick())
local num = math.random(1,6)
print(num.."num")
elseif num == numb then
wait(1)
math.randomseed(tick())
local num = math.random(1,6)
print(num.."num1")
else
break
end
end
As can be seen in the screenshot, num and numb = the same number so it went to the if statement and changed the number to 2 but then kept going??

5 comments
What are you trying to do here?
Get 3 different numbers (it's for a voting system)
Well the script seems fine for me, Is there any error messages?
nope
Before I put prints in the loop and for some reason it just ignored the if statement and kept randomising the number