Yuari
Documentation

gettenv

Returns a function environment table.

Syntax

gettenv(fn: function) -> table

Parameters

ParameterTypeDescription
fnfunctionThe function or callback to use.

Returns

TypeDescription
tableA function environment table

Description

gettenv 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 function f() end
print(gettenv(f))

Notes

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