if statement lua code example
Example 1: elseif lua
if op == "+" then
r = a + b
elseif op == "-" then
r = a - b
elseif op == "*" then
r = a*b
elseif op == "/" then
r = a/b
else
error("invalid operation")
end
Example 2: if statement lua
if (conditon) then
--action #1
elseif (condition) then
--action #2
else
--action #3
end
Example 3: lua if else
if bool then
--code
else
--code
end