Что такое формат файла LUAU?
Файл .luau содержит исходный код, написанный на Luau - языке программирования, который Roblox разработала на основе .lua (Lua 5.1). Roblox Corporation впервые представила Luau разработчикам в 2019 году и выпустила его как открытый исходный код под лицензией MIT в 2021 году. Файл представляет собой обычный текст в кодировке UTF-8, поэтому его может прочитать любой редактор.
Luau сохраняет совместимость с Lua 5.1, добавляя при этом систему постепенной типизации, вывод типов, интерполяцию строк и песочницу (sandboxing). Внутри Roblox Studio каждый Script, LocalScript и ModuleScript сохраняется на диск как файл .luau. Отдельное расширение позволяет редакторам и линтерам распознавать синтаксис Luau, а не обрабатывать его как обычный Lua. Помимо Roblox, такие студии, как Remedy и Digital Extremes, встраивают Luau в свои собственные игровые движки, поэтому вы можете встретить файлы .luau и за пределами мира Roblox.
Безопасность и защита
РИСК: 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.
Детали формата
в двух словахПрограммы, открывающие файлы 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. Технические подробности
глубокая спецификация| 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. |
| Выпущен | 2019 |
| Последняя версия | N/A (rolling releases; no versioned file format) |
| Открыть стандартное | Да · без роялти |
| Спецификация | luau.org |
Конвертации LUAU
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах LUAU.
Часто задаваемые вопросы
Что такое файл .luau?
Как открыть файл .luau?
luau.В чем разница между .luau и .lua?
.luau помечает файлы, написанные на диалекте Luau от Roblox, который добавляет аннотации типов и другие функции. Roblox Studio сохраняет свои скрипты как .luau, в то время как .lua используется стандартным Lua и старыми экспортами Roblox.Можно ли запустить файл .luau вне Roblox?
luau с открытым исходным кодом из релизов проекта на GitHub и запустите luau yourfile.luau. Скрипты, вызывающие специфические API Roblox, не будут работать вне движка Roblox.