getmenv
Returns the environment of a loaded ModuleScript.
Does not require the module for you.
getmenv(target: ModuleScript): tableParameters
| Parameter | Type | Description |
|---|---|---|
target | ModuleScript | Module that has already been required. |
Example
local target = game:FindFirstChildWhichIsA("ModuleScript", true)
if target then
local ok, env = pcall(getmenv, target)
print(ok, type(env))
endExample output
true tableErrors: Raises if the module has not been required or its environment cannot be reached.
