Wiki Page, Programming School: Lesson 3: Indentation and when necessary

Wiki Page
2017-01-27T10:25:03-07:00

"Indentation" in Lua is when you indent your code. You indent by hitting tab on your keyboard. This is not necessary during normal code, and won't work if you tried. This is only needed when in while loops, functions, if statements, etc. Each of those are ended by the 'end' statement, and you remove ONE indent before the 'end'.

Example:

i = 1

--This will run 5 times

while (i <= 5) do

print(i)

i = i+1

end