LUAU ファイル形式とは?
.luauファイルは、.lua (Lua 5.1)から派生したRobloxのスクリプト言語であるLuauで書かれたソースコードを保持します。Roblox Corporationは2019年にLuauを開発者向けにリリースし、2021年にMITライセンスの下でオープンソースとして公開しました。このファイルはプレーンなUTF-8テキストであるため、あらゆるエディタで読み取ることができます。
LuauはLua 5.1との互換性を維持しつつ、漸進的型システム、型推論、文字列補間、およびサンドボックス化を追加しています。Roblox Studio内では、すべての Script、LocalScript、および ModuleScript が.luauファイルとしてディスクに保存されます。拡張子を分けることで、エディタやリンターが通常のLuaとしてではなく、Luauの構文として認識できるようになります。Roblox以外でも、RemedyやDigital Extremesなどのスタジオが自社のゲームエンジンにLuauを組み込んでいるため、Roblox以外の環境でも.luauファイルを見かけることがあります。
セキュリティと安全性
リスク: 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 の変換
コミュニティ Q&A
ユーザーからの質問まだ質問はありません。LUAU ファイルについて最初の質問をしてみましょう。
よくある質問
.luauファイルとは何ですか?
.luauファイルはどうやって開きますか?
luauコマンドラインツールを使用して実行することも可能です。.luauと.luaの違いは何ですか?
.luauは、型注釈などの機能が追加されたRobloxのLuau方言で書かれたファイルであることを示します。Roblox Studioはスクリプトを.luauとして保存しますが、.luaは標準のLuaや古いRobloxのエクスポートで使用されます。Roblox以外で.luauファイルを実行できますか?
luauバイナリをダウンロードし、luau yourfile.luauを実行してください。ただし、Roblox固有のAPIを呼び出すスクリプトは、Robloxエンジン以外では動作しません。