vLuau is a Luau VM with compiler which can be ran in Roblox.
Like vLua but with Fully Luau Support.
You can use this module instead of loadstring in roblox but with sandboxed bytecode.
- vLuau - me (sussy person / sukru / kosuke14 / reboy)
- Fiu (Luau v3 Bytecode Interpreter) - TheGreatSageEqualToHeaven and Rerumu
- LuauInLuau (Translated compiled Luau source to Luau) - RealEthanPlayzDev and Rerumu
local loadstring = require(path.to.MainModule) -- requiring vLuau MainModule
loadstring(<string:(source or bytecode)>[, table:env, string:chunkname]): function
-- compile code and build function
loadstring.luau_execute(...)
-- same as above
loadstring.luau_compile(<string:source>[, string:chunkname]): string
-- compile code and return bytecode
loadstring.luau_load(<string:bytecode>[, table:env]): function
-- build function with provided compiled bytecode
-- Examples:
loadstring("print('hello world!')", getfenv(0))()
-- (OUTPUT) hello world!
loadstring("a", nil, 'syntaxTest')()
-- (ERROR) syntaxTest:1: Incomplete statement: expected assignment or a function call
Roblox Model is available at vLuau (lowercase u)
- Go LuauInLuau and build them with latest Luau (currently, v4 format is not supported)
- Replace LuauInLuau.luau with the built version.
- Place Instances in Roblox like this:
├── <ModuleScript> MainModule (init.lua)
| ├── <ModuleScript> LuauInLuau (LuauInLuau.luau)
└── └── <ModuleScript> Fiu (Fiu.luau)
Roblox Studio could be crashed when you try to paste the large script into Roblox Studio.
This tips may solve that problem.
- Open some place on Studio.
- Right click somewhere in Explorer, and click on 'Insert from file'.
- Find the large script to insert.
- Name the script to something to locate it easily.
- Save place or the script as XML format (place: .rbxlx, model: .rbxmx)
- Open the saved file with your text editor.
- Find the script item.
- Change
<Item class="Script"
to<Item class="ModuleScript"
then save it. - Open the file as Studio and the script is now ModuleScript.