getscriptclosure
Returns a fresh closure of a script's body without running it, which lets you inspect its constants and upvalues.
Signature
getscriptclosure(script: BaseScript): (...any) -> ...anyParameters
scriptLocalScript | ModuleScriptThe script to wrap.
Returns
function
Example
local module = game:GetService("ReplicatedStorage").Config
local closure = getscriptclosure(module)
print(closure()) -- the table the module returns, without requiring it