What Coding Language Does Roblox Use? (Luau)

By Blox Handbook•

Roblox uses Luau, a programming language that Roblox derived from Lua 5.1. Every script in every Roblox game is written in Luau, and you write and run it inside Roblox Studio.

What is Luau?

Luau is Roblox’s own version of Lua, built for the performance and safety that millions of games need. Roblox made it open source in 2021, so its source code and documentation are public.

Luau keeps what makes Lua easy for beginners, simple syntax and few rules, and adds 3 things:

  • Gradual typing: you can add type annotations to catch mistakes early, or leave them out.
  • Speed: a faster interpreter and compiler than standard Lua 5.1.
  • Safety: a sandbox that stops scripts from touching the player’s computer.

What does Luau code look like?

This script prints a message and changes a part’s color every second:

local part = script.Parent

print("Hello from Luau!")

while true do
	part.BrickColor = BrickColor.Random()
	task.wait(1)
end

Is Luau the same as Lua?

Mostly, for a beginner. Code written for Lua 5.1 generally runs in Luau, and Lua tutorials teach the same basics. The differences show up in advanced features such as types and newer syntax. Roblox-specific parts, like script.Parent, game:GetService() and events, come from the Roblox engine, not the language.

Is Luau hard to learn?

Luau is one of the easier languages to start with, and Roblox Studio shows your results instantly. Our guide on how to script on Roblox walks through a first script step by step.