Whenever I say repeat wait() until foo or bar, the repeat keeps waiting until foo AND bar is true. Why is that, and how can I fix this?
✓ ANSWER ACCEPTED
How Can I Replicated "Or" Statements Using A Repeat-Until Statement?
1 answer
✓ Accepted answer
I believe this is an issue with your code. This example works as it should
local foo, bar
spawn(function()
wait(math.random(1, 5))
foo = true
wait(math.random(1, 5))
bar = true
end)
repeat print(foo, bar) wait() until foo or bar
print(foo, bar)
Output:
nil nil (x30) true nil
This discussion is preserved as it was. New answers, comments, and votes are closed.
