Returns the main closure of a LocalScript or ModuleScript, recompiled from the script’s bytecode on every call.
Each call recompiles the closure from the script’s bytecode.
Parameters
Returns
function
Aliases
Example
In a game whose shop UI is a LocalScript, recover its hardcoded string literals even though Roblox stripped .Source on the client.
Roblox strips LocalScript.Source and ModuleScript.Source to empty strings on the client. getscriptclosure() paired with debug.getconstants() is the way around it - the returned closure carries the script’s bytecode, which debug reads directly.