Returns Athena’s shared global environment, the table your scripts run against. Values written here persist across separate executions in the same Lua state and are visible to every script Athena runs there.

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 = ... makes foo visible 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 through run_on_actor arguments or a communication channel rather than expecting a shared getgenv.
Because the executor global persists, it’s the right home for a run-once guard. A plain local resets on every execution and won’t protect you from a double load, whereas a flag on getgenv survives:

Example

Expose an API from one execution that a later one can reuse by name:
  • getrenv: the game’s environment, not Athena’s.
  • getreg: the Luau registry.