когда я набираю что-то еще, кроме + - * или /, он все равно все распечатывает, только в конце он говорит "недействительно"
print("+-*/?")
method = io.read()
if method == "+" or "-" or "*" or "/" then
print("type a number")
num1 = io.read()
print("type another number")
num2 = io.read()
elseif method ~= "+" or "-" or "*" or "/" then
print("invalid")
end
if method == "+" then
plusnum = num1 + num2
print(plusnum)
elseif method == "-" then
minusnum = num1 - num2
print(minusnum)
elseif method == "*" then
timesnum = num1 * num2
print(timesnum)
elseif method == "/" then
percentnum = num1 / num2
print(percentnum)
end





Ваша ошибка находится в следующей строке:
if method == "+" or "-" or "*" or "/" then
От Справочное руководство Lua 5.3 3.4.5 Логические операторы
The logical operators in Lua are and, or, and not. Like the control structures (see §3.3.4), all logical operators consider both false andnil as false and anything else as true.
Итак, независимо от метода, условие вашего оператора if всегда будет оцениваться как true, поскольку вы or используете хотя бы одно значение true, что приводит к true.
Как уже упоминал Егор, вы должны использовать:
if method == "+" or method == "-" or method == "*" or method == "/" then