Correct my first Lua script? Please. :3
It's supposed to be a calculator.
while true do
print("calculator loaded")
print("Which operation would you like? Addition, or subtraction?")
sign = io.read()
if string.lower(sign) == "addition" then
print("What would be your first number?")
local first = io.read("*n")
print("First number is "..first)
print("What would be your second number?")
local second = io.read("*n")
print("Second number is "..second)
print("adding")
wait(1)
print("Answer is "..first + second)
elseif string.lower(sign) == "subtraction" then
print("What would be your first number?")
local first = io.read("*n")
print("First number is "..first)
print("What would be your second number?")
local second = io.read("*n")
print("Second number is "..second)
print("adding")
wait(1)
print("Answer is "..first - second)
end |