getgenv Synchronous

Open the shared Kawaii environment for the current executor session. This is a useful home for a tool's state when separate scripts need to find the same table.

Syntax
Luau
getgenv() -> Table

Parameters

This function takes no arguments.

Returns

Table

The shared executor environment table.

Usage notes

Keep your own values under a distinctive key so they do not collide with globals published by Kawaii or another script.

The returned table is the live environment, not a copy.

Example

Example
Luau
local env = getgenv()
env.ExampleCounter = (env.ExampleCounter or 0) + 1
print("This session has run the example", env.ExampleCounter, "times")
Kawaii documentation