Skip to content
/ vLuau Public
forked from kosuke14/vLuau

Luau VM with compiler can be ran in Luau.

License

Notifications You must be signed in to change notification settings

luau/vLuau

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vLuau

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.

Credits

Usage

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)

Building

  1. Go LuauInLuau and build them with latest Luau (currently, v4 format is not supported)
  2. Replace LuauInLuau.luau with the built version.
  3. Place Instances in Roblox like this:
├── <ModuleScript> MainModule (init.lua)
|   ├── <ModuleScript> LuauInLuau (LuauInLuau.luau)
└── └── <ModuleScript> Fiu (Fiu.luau)

Tips to add large 'ModuleScript' into Roblox Studio

Roblox Studio could be crashed when you try to paste the large script into Roblox Studio.
This tips may solve that problem.

  1. Open some place on Studio.
  2. Right click somewhere in Explorer, and click on 'Insert from file'.
  3. Find the large script to insert.
  4. Name the script to something to locate it easily.
  5. Save place or the script as XML format (place: .rbxlx, model: .rbxmx)
  6. Open the saved file with your text editor.
  7. Find the script item.
  8. Change <Item class="Script" to <Item class="ModuleScript" then save it.
  9. Open the file as Studio and the script is now ModuleScript.

About

Luau VM with compiler can be ran in Luau.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 100.0%