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
decompileDecompiles a Roblox script and returns the generated source text when bytecode is available.
dumpstringReturns the decompressed bytecode string for a Roblox script object.
getcallingscriptReturns the Script Instance associated with the current Luau thread, or nil when no script is associated with it.
getinstancesbyclassReturns instances from the Instance cache table whose ClassName field exactly matches the requested string.
getloadedmodulesReturns a new array table containing live entries from loaded module list.
getmenvReturns the environment table associated with a ModuleScript.
getreferencedbyReturns cached Instance values whose supported reference properties point to the provided Instance.
getrunningscriptsReturns a new array table of unique script Instances taken from live Lua threads.
getscriptbytecodeReturns the decompressed bytecode string for a Roblox script object.
getscriptclosureLoads the stored bytecode for a supported Roblox script Instance and returns it as a Lua closure.
getscripthashReturns an uppercase SHA384 hex digest for the stored bytecode string of a Roblox script object.
getscriptsReturns script object values currently present in the Instance cache.
getscriptthreadReturns the Lua thread associated with a script object when Real can find one.
getsenvReturns the environment table associated with a LocalScript, Script, or ModuleScript.
loadstringCompiles a Luau source string and returns the loaded function.