getsenv
function getsenv(script: Script | LocalScript | ModuleScript): { [any]: any }Parameter
Example
local ScriptEnv = getsenv(game.Players.LocalPlayer.Character.Animate)
print(ScriptEnv.onSwimming) -- Output: function 0x...
print(getsenv(Instance.new("LocalScript"))) -- Throws an errorLast updated