getscriptclosure
Returns the main closure of a script instance.
function getscriptclosure(scriptscriptScript | LocalScriptThe script instance to retrieve the closure from.: Script | LocalScript): functionfunctionThe main chunk closure of the script.Usage
Access script upvalues
local script = game.Players.LocalPlayer.PlayerScripts.SomeScript
local closure = getscriptclosure(script)
print(debug.getupvalues(closure))