Creator Hub → Luau → Beginner
Roblox Luau Tutorial for Beginners
Learn Roblox scripting from zero with interactive examples, visual experiments, coding challenges and a real Roblox Studio project.
What you will build
By the end, you'll understand the code behind a simple disappearing platform and be able to rebuild it in Roblox Studio.
Open full Studio project →How to use this guide
- Read
- Try
- Change
- Run
- Observe
- Challenge yourself
- Build it in Studio
What is Luau?
If you want to build games on Roblox — not just play them — you need scripting. Roblox uses Luau, and you write it inside Roblox Studio.
Official Roblox documentation describes Luau as derived from Lua 5.1, with Roblox-oriented enhancements such as optional typing and generalized iteration. In practice, many Lua beginner habits still apply, while Studio and the engine give you game objects, services, and events to control.
You write Luau in the Script Editor. Scripts live in the Explorer tree as Instances — the same hierarchy that holds Parts, Folders, GUIs, and services. Scripting is what turns a static place into a game: doors that open, coins that save, UI buttons that respond, and rounds that start on a timer.
Try your first Luau
Output
What do you need / your first Studio script
Before your first line of Luau in Studio, set up: a Roblox account, Roblox Studio signed in, a Baseplate place, Explorer visible, and the Output window open (View → Output). Script Analysis is optional but helpful.
Beginner checklist: create a place → open Output → insert a Script under ServerScriptService → press Play → watch Output. Stop Play when you edit, then Play again so Studio reloads scripts cleanly.
print() writes to Output; it does not change the 3D world by itself.print("Hello from BloxBuzz!")
Luau variables
Variables store values you reuse. In normal Roblox scripting, prefer local variables and functions — clearer scope and typically faster lookup. Names should be readable (coins, not c). If Output shows nil, the name is wrong, the value was never set, or you are reading outside its scope.
coins
Output
Change it: set 10 → 100, Run, and observe.
Data types
Output
Luau functions
A function is a reusable action. Games call functions when a round starts, when a player joins, or when a purchase succeeds. Name functions after actions (giveCoins, resetRound), not vague labels like doStuff.
Output
Challenge: create a heal() function that prints Healed!.
Beginner mistake
Defining a function but forgetting to call it with ().
If / else — door lab
Interactive BloxBuzz simulation
Output
Beginner mistake
if coins >= 10
print("Reward")
end
Missing then. Correct: if coins >= 10 then.
Luau loops
Output
Also learn while with a yield in Studio:
task.wait() (not old global wait()). Infinite while true without a yield can freeze Studio.
local countdown = 5
while countdown > 0 do
print(countdown)
task.wait(1)
countdown -= 1
end
What happens if? Change 5 → 10 in the Browser Luau lab and Run.
Tables — inventory lab
INVENTORY
Output
Challenge: Add "Bow", sync the visual, then Run.
Events
Interactive BloxBuzz simulation
part.Touched:Connect(function(hit)
print("Something touched the part!")
end)
Part property lab
Interactive BloxBuzz simulation — CODE → PROPERTY → VISUAL
What happens if? Transparency = 1, or CanCollide = false.
Script hierarchy
script.Parent points to DisappearPlatform — the object containing this Script.
Script vs LocalScript vs ModuleScript
Server / game logic (fair rules, scoring). Place in server containers like ServerScriptService.
Exact behavior depends on type, location, and RunContext — these are beginner defaults, not absolute laws.
Change player's camera →
Server-side score logic →
Reusable utility functions shared by many scripts →
Where should my script go?
Click a location to learn what usually belongs there.
Client vs server
Interactive BloxBuzz simulation
Input · UI · Camera
Rules · Data · Security
Flagship project: disappearing platform
Build this in Roblox Studio
Difficulty: Beginner · Time: 10–15 min · Skills: variables, functions, properties, loops, timing
- Create Part · Anchor · Rename DisappearPlatform
- Insert Script as child
- Understand
script.Parent - Function changes Transparency + CanCollide
task.wait· restore · loop · test · change timing · debug
local platform = script.Parent
local function disappear()
platform.Transparency = 1
platform.CanCollide = false
task.wait(3)
platform.Transparency = 0
platform.CanCollide = true
end
while true do
task.wait(5)
disappear()
end
Project challenges: disappear faster · stay invisible 5 seconds · change the behavior.
Full project pagePredict the output
local coins = 10
coins = coins + 5
print(coins)
Fix the code
How to debug
- Error
- Read Output
- Find line
- Understand
- Check object / location
- Fix
- Run again
Use Output, Script Analysis, print, warn, and Explorer before rewriting everything. When an error mentions a line number, jump there first — “attempt to index nil” almost always means something you thought existed is missing.
Common beginner mistakes
- Forgetting
local— prefer local variables/functions. - Wrong Explorer location — Script under ServerScriptService for server practice; LocalScript under client starters for UI.
- Infinite loop without
task.wait()— Studio freezes. - Missing
then/end— parse errors; use Script Analysis. - Not checking Output — the error usually explains the fix.
You learned
- ✓ Luau basics
- ✓ Variables
- ✓ Functions
- ✓ Events
- ✓ Conditions
- ✓ Loops
- ✓ Tables
- ✓ Script types
Next: practice in the Playground, try Challenges, then build Studio projects.
Deep-dive lesson pages will publish when each topic is fully written — no placeholder links.
Frequently asked questions
Is Luau the same as Lua?
Luau is Roblox’s scripting language derived from Lua 5.1 with Roblox-oriented enhancements. Many Lua basics transfer, but always verify Roblox APIs and Studio placement in official docs.
Is Luau hard to learn?
Beginners can learn Luau with short Studio practice sessions. Start with print, variables, and one Part example before advanced topics like remotes.
Can beginners learn Luau?
Yes. This guide is written for first-time creators. Type each sample, press Play, and use Output to confirm what happened.
Do I need Roblox Studio to learn Luau?
For Roblox game scripting, yes — Studio is where you create Scripts, playtest, and read Output. General Lua concepts can be studied elsewhere, but Studio is required for real Roblox work.
Can I use Lua tutorials to learn Luau?
Lua tutorials help with language basics, but Roblox script types, services, events, and placement rules come from Roblox documentation and Studio practice.
What should I learn first in Roblox scripting?
Learn print/Output, local variables, functions, if/else, loops with task.wait, then Script vs LocalScript and simple Part changes.
What is the difference between Script and LocalScript?
Scripts commonly run server logic from server containers. LocalScripts run on the client for UI and input. Placement matters — the wrong container often means the script never runs.
Where do Roblox scripts run?
It depends on script type and location (and Script RunContext). ServerScriptService is a solid default for beginner server Scripts; client UI usually uses LocalScripts under starter containers.