Understanding Lua Basics
Roblox runs on Luau, a fast dialect of Lua. If you want to read, tweak or write your own scripts, the place to start is the handful of core building blocks every Lua script is made of: variables, types, tables, functions and control flow.
Get a free executor
You need an executor to run any Roblox script. Grab one free.
Variables and types
A variable is a named box that holds a value. In Lua you declare one with local — local speed = 16 — and the common value types are number, string, boolean (true/false), and nil (nothing).
Always prefer local variables. They are faster than globals and keep your code from accidentally clashing with the game's own variables.
Tables — Lua's one data structure
Tables are how Lua stores collections of anything: lists, dictionaries, objects. You create one with curly braces and index it by position or key. Almost every non-trivial script leans on tables to hold players, settings, or saved positions.
Understanding tables early pays off, because Roblox itself hands you tables constantly — the list of players, a model's children, and so on.
Functions and control flow
Functions group reusable logic; control flow decides what runs. The essentials are if/then/else for decisions, for and while for loops, and functions to package steps you repeat. A huge share of script behaviour is just "loop over the players, and if a condition is true, do something".
Once these click, read creating custom functions to write your own, and script structure and best practices to organise them.
Where to go next
With the basics down, move on to getting started with Lua scripting to set up your environment, then working with Roblox events to react to things happening in-game.