Control structures are used to make decisions in code; they control the path of code based on a Boolean value. Lua provides the if statement for this purpose. An if statement is followed by a Boolean condition, which in turn is followed by a then/end chunk. The chunk is only executed when the Boolean condition evaluates to true.
The most basic syntax of an if statement is as follows: