Luau vs Lua: which obfuscation target should you pick?
The difference between Luau, Lua 5.1 and Lua 5.4 - and which target to choose when you obfuscate your script. - 5 min read
The three dialects
Lua 5.1 is the classic version still embedded in countless games and apps. Lua 5.4 is the modern standalone release with current language features. Luau is Roblox's own dialect - derived from Lua 5.1 but evolved separately with its own syntax, type system, and standard library.
They look similar but aren't interchangeable. Code written for one can fail in another, and an obfuscator has to emit output that respects the target's rules.
How they differ in practice
Luau adds gradual typing, compound assignment operators, generalized iteration, and a different standard library surface. Lua 5.4 added integer division and new bitwise semantics over 5.1. Globals like game, workspace, and script exist only inside Roblox; the global _G table means different things in each environment.
For obfuscation this matters on both ends: the input may use dialect-specific syntax that must parse, and the output must only use constructs the target environment actually provides.
Why the target matters for obfuscation
Protected code has to run in a specific environment. Each environment exposes different globals, different loading functions, and different syntax rules. Picking the right target means the output is built for exactly where it will execute - no compatibility surprises.
This is why Obrion asks for a target instead of guessing: a Luau build and a Lua 5.4 build of the same source are deliberately different programs.
Which one to pick
- Roblox game scripts - pick Luau.
- Scripts meant to run inside Roblox executors - pick Executor.
- OpenResty, game mods, older embedded hosts - pick Lua 5.1.
- Modern standalone Lua, World of Warcraft-style addons on current runtimes - pick Lua 5.4.
Finding your host's Lua version
Not sure what your host runs? Check its documentation first. In-game, print(_VERSION) reports the base version - Roblox reports 'Luau', most embedders report 'Lua 5.1' or 'Lua 5.4'. Frameworks like OpenResty and LÖVE document their dialects openly.
When in doubt
If your script runs on Roblox, the answer is Luau or Executor - never the plain Lua targets. If it runs anywhere else, match the Lua version of the host application. When you're unsure, test the protected output in the real environment before shipping.
Start obfuscating free - sign in with Discord