Posted 21 August 2016 - 03:29 AM
I have some experience coding, but not so much with Lua so I'm sure my issue is just a small nuance that I am missing that is particular to Lua. All I'm trying to do is wait for a user to put in a correct value for a choice (1 or 2) and loop the question until they put in the right response. What the code is doing instead is infinitely looping even when the value being checked is correct. I've tested my code logic out in C# and it works as expected, with Lua however, it seems to be broken. I'm playing the FTB Infinity pack. Please help me see what I'm missing if you could. Thanks.
number = 5
while number~=1 or number~=2 do
print("choose 1 or 2")
print("number is: " .. number)
number = read()
print("number is now: " .. number)
end
print("out of loop")
read() --for pause to check output