Building creates the world of a Roblox game. Luau makes that world do things. A script can open a door, count points, move an enemy or decide what happens when a player touches a button.
People often call the language Lua, but Roblox Studio uses Luau. It started from Lua 5.1 and now has extra features made for Roblox development.
What a script can control
Scripts can react to player input, run game events, control non-player characters, save data and update interfaces. Most larger Roblox games use many scripts that work together rather than one enormous file.
The first ideas to learn
- Variables: Names that hold information, such as a score or player name.
- Functions: Reusable instructions for doing a task.
- Conditions: Choices such as “if the player has a key, open the door”.
- Loops: Instructions that repeat.
- Tables: Collections that can hold lists or named pieces of information.
- Events: Signals that something happened, such as a player touching a part.
Roblox Studio helps while you learn
The Script Editor includes syntax colours, autocomplete, type checking and warnings. The Output window shows messages and errors when you test the game. An error is not a failure; it is usually a clue pointing towards the line that needs attention.
Start with one small action
Do not begin by trying to script an entire multiplayer game. Make one part change colour, print a message or react when touched. Once that works, add one more behaviour.
Avoid pasting long scripts or free models you do not understand. Read the code, test it in your own place and ask what each section does. Learning slowly gives you much more control later.