Wat is het LUAU-bestandsformaat?
Een .luau-bestand bevat broncode geschreven in Luau, de scripttaal die Roblox heeft afgeleid van .lua (Lua 5.1). Roblox Corporation leverde Luau voor het eerst aan ontwikkelaars in 2019 en gaf het in 2021 vrij als open source onder de MIT-licentie. Het bestand is platte UTF-8-tekst, dus elke editor kan het lezen.
Luau behoudt compatibiliteit met Lua 5.1 terwijl het een geleidelijk typesysteem, type-inferentie, string-interpolatie en sandboxing toevoegt. Binnen Roblox Studio wordt elke Script, LocalScript en ModuleScript op schijf opgeslagen als een .luau-bestand. De aparte extensie zorgt ervoor dat editors en linters Luau-syntaxis herkennen in plaats van het als gewone Lua te behandelen. Buiten Roblox om integreren studio's zoals Remedy en Digital Extremes Luau in hun eigen game-engines, dus u kunt ook buiten de Roblox-wereld .luau-bestanden tegenkomen.
Beveiliging & veiligheid
RISICO: MEDIUMA .luau file is plain-text source code and cannot run on its own; it only executes inside Roblox, the luau runtime, or another host that embeds Luau. Like any script, code from an untrusted source can perform unwanted actions when run, and the Roblox community has seen malicious model scripts (backdoors) shipped inside shared assets. Read the source before running it, and be cautious with obfuscated or copy-pasted scripts.
Formaatdetails
in een notendopProgramma's die LUAU-bestanden openen
.luau on disk. .luau file directly; install the Luau Language Server extension for syntax highlighting, type checking, and autocomplete. luau script.luau in a terminal to execute the file, or luau-analyze script.luau to type-check and lint it. .luau files. .luau file; add the Luau Language Server extension for full language support. luau script.luau or analyze it with luau-analyze script.luau from Terminal. .luau file and install the Luau Language Server extension for highlighting and diagnostics. luau script.luau to execute or luau-analyze script.luau to check the file. .luau; edit them in the browser-linked Studio environment. Technische details
diepe specificaties| Encoding | UTF-8 plain text (ASCII-compatible) |
| Byte order | N/A (text, no multibyte header) |
| Container | None; flat source file |
| Typical size | A few hundred bytes to tens of kilobytes |
| Structure | Human-readable Luau source code. May start with an optional mode directive comment (--!strict, --!nonstrict, or --!nocheck), followed by statements, function and type definitions. Type annotations on variables, parameters and return values are optional. |
| Integrity | None built in |
| Platforms | Windows, macOS, Linux, Web (Roblox platform) |
| Language Derived From | Lua 5.1 |
| Type System | Gradual, structural type inference (opt-in annotations) |
| Runtime | C++ Luau VM with rewritten interpreter, incremental garbage collector, and native x64/ARM64 code generation |
| Line Terminator | LF or CRLF |
| Notes | Luau is backward compatible with Lua 5.1 source, so many .luau files also run under a plain Lua 5.1 interpreter unless they use Luau-only syntax such as type annotations, string interpolation, or the continue keyword. |
| Uitgebracht | 2019 |
| Laatste versie | N/A (rolling releases; no versioned file format) |
| Open standaard | Ja · royaltyvrij |
| Specificatie | luau.org |
LUAU conversies
Community V&A
gevraagd door gebruikersNog geen vragen - wees de eerste om iets te vragen over LUAU-bestanden.
Veelgestelde vragen
Wat is een .luau-bestand?
Hoe open ik een .luau-bestand?
luau command-line tool.Wat is het verschil tussen .luau en .lua?
.luau markeert bestanden die zijn geschreven voor het Luau-dialect van Roblox, dat type-annotaties en andere functies toevoegt. Roblox Studio slaat zijn scripts op als .luau, terwijl .lua wordt gebruikt door standaard Lua en oudere Roblox-exports.Kan ik een .luau-bestand buiten Roblox uitvoeren?
luau-binaries van de GitHub-releases van het project en voer luau uwbestand.luau uit. Scripts die Roblox-specifieke API's aanroepen, werken niet buiten de Roblox-engine.