Che cos'è il formato di file LUAU?
Un file .luau contiene codice sorgente scritto in Luau, il linguaggio di scripting che Roblox ha derivato da .lua (Lua 5.1). Roblox Corporation ha introdotto Luau per gli sviluppatori nel 2019 e lo ha rilasciato come open source sotto licenza MIT nel 2021. Il file è in formato testo semplice UTF-8, quindi qualsiasi editor può leggerlo.
Luau mantiene la compatibilità con Lua 5.1 aggiungendo al contempo un sistema di tipi graduale, l'inferenza dei tipi, l'interpolazione delle stringhe e il sandboxing. All'interno di Roblox Studio, ogni Script, LocalScript e ModuleScript viene salvato su disco come file .luau. L'estensione separata consente agli editor e ai linter di riconoscere la sintassi Luau invece di trattarla come normale Lua. Oltre a Roblox, studi come Remedy e Digital Extremes integrano Luau nei propri motori di gioco, quindi è possibile incontrare file .luau anche al di fuori del mondo Roblox.
Sicurezza e incolumità
RISCHIO: 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.
Dettagli del formato
in sintesiProgrammi che aprono file LUAU
.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. Dettagli tecnici
specifiche approfondite| 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. |
| Rilasciato | 2019 |
| Ultima versione | N/A (rolling releases; no versioned file format) |
| Standard aperto | Sì · royalty-free |
| Specifica | luau.org |
Conversioni LUAU
Domande e risposte della community
chiesto dagli utentiAncora nessuna domanda - sii il primo a chiedere informazioni sui file LUAU.
Domande frequenti
Cos'è un file .luau?
Come si apre un file .luau?
luau.Qual è la differenza tra .luau e .lua?
.luau identifica i file scritti per il dialetto Luau di Roblox, che aggiunge annotazioni di tipo e altre funzionalità. Roblox Studio salva i suoi script come .luau, mentre .lua è usato dal Lua standard e dalle vecchie esportazioni di Roblox.Posso eseguire un file .luau al di fuori di Roblox?
luau dai rilasci GitHub del progetto ed esegui luau tuo-file.luau. Gli script che richiamano API specifiche di Roblox non funzioneranno al di fuori del motore Roblox.