Luau is the scripting language used in Roblox Studio. It is a fast, small, safe, gradually typed embeddable scripting language derived from Lua 5.1. Use Luau in scripts to make your experience dynamic and interactive. For a comparison of language features in Luau and C#, see Luau and C# Comparison.
Support in Studio
The Script Editor in Studio supports Luau with autocompletion, syntax highlighting, static linting, type checking, and script analysis. It also shows documentation and function signatures for members of the Roblox Engine API.
Types
Luau includes the following data types:
- Strings are sequences of characters, such as letters, numbers, and symbols.
- Enums are fixed lists of items.
Luau is dynamically typed by default. Variables, function parameters, and return values can be any data type. This helps you write code faster because you don't need to provide types for each piece of data. You can still declare explicit types for variables in Luau and enable strict type checking to make type issues obvious and easy to locate.
Features
In Luau, variables and functions can have global and local scope within a script. Luau has logical, relational, and compound assignment operators. You can use control structures and functions to control when Luau executes code. Many operators and variable assignments perform type coercion to change values to the types that Luau expects.