Environment
gettenv
Returns the environment table stored on a Luau thread. getstateenv is an alias.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Returns the environment table stored on a Luau thread. getstateenv is an alias.
gettenv(thread: thread): table
getstateenvlocal thread = coroutine.create(function()
end)
local env = gettenv(thread)
print(type(env))
local aliasEnv = getstateenv(thread)
print(type(aliasEnv))