Skip to main content.

Quick Lua tutorial

General

Variables

Identifiers

Comments

Start anywhere outside a string with a double hyphen (--) and run until the end of the line

Literal strings

Numerical constants

Control structures

while expression do
         block
end
 
repeat
         block
until expression
 
if expression1 then
         block
elseif expression2 then
         block
else
         block
end

for index = start, end, step do
         block
end