getsenv
Returns the environment table of a script instance.
Syntax
getsenv(script: Instance) -> table
Parameters
| Parameter | Type | Description |
|---|---|---|
script | Instance | The script value used by the call. |
Returns
| Type | Description |
|---|---|
table | The environment table of a script instance |
Description
getsenv is part of the Environment library. Environment helpers return or inspect the global, game and script environments used by the executor and the client.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
Example
local script = getscripts()[1]
print(getsenv(script))
Notes
- Mutating a returned environment affects every script that shares it.