Hello im new to LUA and in general new to scripting/coding This is script what im talking about
print("Type a Number!")
repeat
input = io.read()
if input == "10" then
print("Ten")
elseif input == "7" then
print("Seven")
elseif input == "1" then
print("One!")
elseif input == "exit" or input == "Exit" then
print("Exiting...")
else
print("incorrect")
end
until input == "Exit" or input == "exit"
I kinda feel like there is too much elseif but I didn't want to print "incorrect" when i type exit or Exit so my solution was to add another elseif before else command. Can be this be more simplified or i can't do nothing with it and its good
And one more question why this is not working
num = 10
input = io.read()
If input == num then
print("Ten")
end
Or this code
num = 10
input = io.read()
If input == 10 then
print("Ten")
end
Why code above where i have boolean with string after if, only works