< Functions | UserGuide | Lua Variables >
Operators
Conditions
A condition is an expression that is evaluated to a value which is then interpreted astrue or false. In Lua, any value that is not nil or false is true. Conditional blocks are then executed if the condition is true:
if 5+5 == 10 then print("yes, 5+5 is 10") end
We can use certain operators in order to generate true or false values. These operators are in lua
| operator | meaning | true expression |
== | equal | 5==5 |
~= | not equal | 5~=6 |
< | less | 5<6 |
> | greater | 6>5 |
<= | less or equal | 5<=5 |
>= | greater or equal | 5>=5 |
or | true if one of the values is true | true or false |
and | true if both values are true | true and 5 |
not | inverts a value | not false |

