Category

Scripts

Script, bytecode, and environment queries.

Category guide

Overview

Use this overview to understand the category before opening a specific function.
  • See what this group of functions is meant to solve.
  • Compare function names and descriptions in one table.
  • Open a function for syntax, arguments, returns, and examples.

Scripts

Available functions

15 functions
FunctionDescription
decompileAttempts to decompile a script instance into readable Luau source.
dumpstringReturns bytecode or dumped script data for inspection.
getcallingscriptReturns the script associated with the current calling context.
getinstancesbyclassReturns reachable instances whose class name matches the provided class.
getloadedmodulesReturns loaded ModuleScript instances, optionally excluding core modules.
getmenvReturns the module environment for a ModuleScript.
getreferencedbyReturns objects or scripts that reference the provided instance.
getrunningscriptsReturns script instances that are currently running.
getscriptbytecodeReturns the bytecode for a script instance.
getscriptclosureReturns the callable closure associated with a script instance.
getscripthashReturns a stable hash for a script when bytecode is available.
getscriptsReturns all script instances reachable by the runtime.
getscriptthreadReturns the thread associated with a script when one is available.
getsenvReturns the script environment table for a script.
loadstringCompiles a Luau source string and returns the resulting function or an error message.