Lua runtime guide
Protecting MoonLoader and SA:MP Lua scripts
MoonLoader scripts run in a different environment from Roblox scripts. A protected file can be valid Lua and still fail when it reaches a game-specific API, LuaJIT FFI call or native hook. Test in the runtime you actually ship.
Check compatibility before a release
Start with a working source script. Obfuscate one representative build, then run it in the same MoonLoader and SA:MP setup your users have. Exercise startup, event handlers, FFI calls, memory access and shutdown. Compare observable behavior and logs with the original, not just whether the file parses.
LuaJIT and FFI need special attention
Code using ffi.cast, native modules or host-provided functions depends on the surrounding runtime. An obfuscator should preserve calls and values, but it cannot supply missing modules or validate every game memory layout. Keep platform-specific integration tests for each update.
Choosing a protection level
Lite is the public starting point. Advanced access is reviewed individually. More protection may increase output size and startup cost, so use your actual script and environment to decide whether the extra layer is worth it. No client-side obfuscator can make code impossible to reverse.
If a build breaks
Reduce the problem to the smallest script that still fails. Record the MoonLoader version, LuaJIT version, affected API, original behavior and protected behavior. Run the source through Lua Script Doctor for syntax checks, then open a support ticket from your dashboard with a minimal reproducible example.
Try the Lua obfuscator or read the Lua 5.1 and Luau compatibility guide.