Skip to main content
All technologies
Luau logo

What is Luau?

Luau is the scripting language used in Roblox, derived from Lua 5.1 with added types and performance work.

Programming language. Updated by DATAL Projects

Made by
Roblox Corporation
First released
Open sourced in 2021
License
MIT
Written in
C++
Type
Scripting language
Official site
luau.org

What Luau is

Luau is the scripting language used in Roblox, derived from Lua 5.1 with added types and performance work. It is the language that runs Roblox game logic, from combat and shops to saving player data.

Lua is a small scripting language created in 1993 at a university in Rio de Janeiro, Brazil. Roblox chose Lua as its scripting language early on and used version 5.1 for many years. As games on the platform grew bigger, Roblox needed faster code and better tools for large projects.

Roblox rewrote the language tooling in house and named the result Luau. It kept compatibility with Lua 5.1 code while adding a type system, new syntax and a faster interpreter. In 2021 Roblox released Luau as open source under the MIT license, so it can now be used outside Roblox as well.

How Luau works

Luau is a scripting language, which means it is embedded inside a larger program and controls what that program does. In Roblox, the engine handles graphics, physics and networking, and your Luau code tells it what should happen. You write variables, functions, loops and if statements, like in most languages.

The main data structure is the table. A table can act as a list, as a dictionary of keys and values, or as an object. Almost everything in a Luau program is built from tables and functions. Modules are files that return a table of functions, and other scripts load them with require.

Luau adds optional type checking on top of Lua. You can write code with no types at all, or you can add type annotations so the editor warns you about mistakes before the game runs. This is called gradual typing. Luau also runs code in a sandbox, which means scripts cannot reach outside the areas the host program allows.

Key features of Luau

  • Gradual typing

    Types are optional. You can add them file by file and get warnings about wrong arguments or missing fields as you type.

  • Lua 5.1 compatible

    Most Lua 5.1 code runs in Luau without changes. Skills and tutorials from Lua carry over.

  • Faster execution

    Luau has its own compiler and interpreter, tuned for speed. This matters for games that run a lot of logic every frame.

  • Modern syntax

    Luau adds things Lua 5.1 lacks, such as compound assignment like +=, a continue statement, string interpolation and if expressions.

  • Sandboxing

    The language is designed to run untrusted code safely. Scripts only get the libraries the host chooses to expose.

  • Open source

    The compiler, runtime and type checker are public under the MIT license and can be embedded in other programs.

When to use Luau

A good choice for

  • Writing gameplay, UI and data code for Roblox experiences
  • A first programming language, thanks to its small and readable syntax
  • Embedding a safe scripting layer inside a game or app
  • Large Roblox codebases that benefit from type checking

Pick something else when

  • Building websites or mobile apps
  • General server or data science work, where languages like Python have far more libraries
  • Projects that depend on libraries written for newer Lua versions

Luau compared with alternatives

Luau vs Lua

Luau started from Lua 5.1 and stays close to it. Luau adds optional types, extra syntax and performance work, but it does not include every feature from later Lua versions. Standard Lua is the usual pick for embedding in other software, while Luau is the language you use on Roblox.

Luau vs TypeScript

Both add optional types on top of a dynamic language. TypeScript is compiled to JavaScript and is used for web and server work. Luau has its type checker built into the language tools and is mostly used for games.

Luau vs Python

Python is a general purpose language with a very large library collection. Luau is smaller and is made to be embedded inside another program. Learning one makes the other easier, since both are readable and dynamic.

How to start learning Luau

  1. 01Install Roblox Studio, since it is the easiest place to write and run Luau.
  2. 02Read the scripting fundamentals in the Roblox Creator Docs to learn variables, functions, loops and tables.
  3. 03Write a small script, such as a part that disappears when a player touches it and comes back after a few seconds.
  4. 04Move shared code into a ModuleScript and load it with require to learn how projects are organized.
  5. 05Read the guides on luau.org and turn on strict type checking in one script to see how types catch mistakes.

What Luau costs

Luau is free and open source under the MIT license. You can use it in personal and commercial projects without paying anything. Using it inside Roblox is also free, though Roblox has its own terms for publishing and earning.

How DATAL Projects uses Luau

Luau is part of our game development work in the Philippines. Common uses:

  • Roblox gameplay systems
  • Server-side validation and anti-exploit checks
  • Player data and progression

Common questions about Luau

Is Luau the same as Lua?

Not exactly. Luau is based on Lua 5.1 and most Lua 5.1 code works in it, but Luau adds types, new syntax and speed improvements. It also leaves out some features from newer Lua versions.

Is Luau hard to learn?

No. Luau has a small set of rules and reads close to plain English, which makes it a common first language. The harder part is learning the Roblox engine around it.

Is Luau free?

Yes. Luau is open source under the MIT license, and it costs nothing to use in Roblox Studio.

Can I use Luau outside Roblox?

Yes. Since it became open source, developers can embed Luau in their own programs. There are also community runtimes, such as Lune, that run Luau scripts on a computer without Roblox.

Luau vs Lua: which should I learn?

Learn Luau if your goal is making Roblox games. Learn standard Lua if you want to script other software that embeds it. The two are close enough that switching later is easy.

Need a project built with Luau?

Tell us what you need. We reply with a scope, a price, and a timeline.

Start a Project