Variables and Data Types
In Lua, you declare variables with thelocal keyword. Lua is dynamically typed, so you do not need to specify a type — the value itself determines it.
Functions
Functions let you group reusable logic under a name. You can define them withlocal function (scoped) or as values assigned to a variable.
Tables
Tables are Lua’s only data structure — they act as both arrays and dictionaries (key-value maps). They are the backbone of almost every Roblox script.Loops
Lua providesfor, while, and repeat...until loops for iteration.
Conditionals
Useif, elseif, and else to branch your logic. Lua uses and, or, and not instead of &&, ||, and !.
String Concatenation and Length
Lua uses.. to join strings and # to get the length of a string or array-style table.
Keep Learning
Roblox Scripting
Put your Lua knowledge to work inside Roblox Studio with scripts, RemoteEvents, and the full game API.
Debugging Tips
Learn how to read Lua error messages, isolate problems, and fix issues faster.