Returns
table
The executor global table. Writes to it are seen by later executions and by the
globals your chunks resolve against.
Behavior
- Persistence. A value assigned to the executor global outlives the execution that set it. This is the supported way to keep state between runs, expose a shared API, or guard against running setup twice.
- Shadowing. Your chunk resolves an unqualified global by checking its own
globals first, then the executor global, then the game’s globals. Writing
getgenv().foo = ...makesfoovisible everywhere without touching the game environment. - Per-VM in actors. Each Actor VM has its own executor global. Calling
getgenv()inside an actor returns that actor’s table, not the main VM’s. To move data between VMs, pass it throughrun_on_actorarguments or a communication channel rather than expecting a sharedgetgenv.
getgenv survives: