Posted 14 January 2013 - 12:53 AM
I want the user to input a number, store it into a variable and then compare it. But the input seems to be a string i think! I'm a bit of a beginner with lua but i'm getting better and i can't work this out! This is what i got yet.
so how do i make the input variable a number instead of a string or something? I hope i explained correctly, Thanks.
print ("Enter the number")
write ("number: ")
for i = 1, 1000, 1 do
a = read()
if a < 0 then
print ("whatever")
elseif a > 99 then
print ("That's too big!!!!")
else
break
end
end
Now if i run the script and input a number it says: attempt to compare number with string expected, got number.so how do i make the input variable a number instead of a string or something? I hope i explained correctly, Thanks.