Yuari
Documentation

getmenv

Returns a ModuleScript environment. This always returns a table; an empty table is used when no environment is resolved.

Syntax

getmenv(script: Instance) -> table

Parameters

ParameterTypeDescription
scriptInstanceThe script value used by the call.

Returns

TypeDescription
tableA ModuleScript environment

Description

getmenv 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 module = getloadedmodules()[1]
print(getmenv(module))

Notes

  • Mutating a returned environment affects every script that shares it.