Migrating From GLua
Lux migration is not a line-by-line rewrite. Start by moving handwritten load
order, globals, and runtime SERVER/CLIENT branching into the Lux module
model.
Replace Loaders with Imports
Loader migration
The GMod backend generates loader files from the resolved module graph.
Replace if SERVER Blocks with Realm Blocks
Realm block migration
The server block is emitted only into server-capable artifacts. Shared code outside that block still cannot call server-only APIs.
Realm block generated shape
Split Large Files into Parts
Do not create a fake package just because one file got too large. Put related files under the same module directory:
All part files share module-private top-level declarations. Use part order
only when non-function top-level initialization must happen in a specific
sequence.
Part order
Keep Public API Small
Public name mapping
Other modules import the public name.
Import public name
The internal name player_inventory remains private.