Scripts

The Scripts library provides functions for interacting with running scripts, loading modules, and compiling code.

Overview

These functions allow you to:

  • Get references to running scripts
  • Access script environments
  • Load and compile Luau code
  • Extract script information

Available Functions

FunctionDescription
decompileDecompile a script into Luau source
getcallingscriptGet the script that called the current function
getfunctionbytecodeGet bytecode for a Luau closure
getloadedmodulesGet all loaded ModuleScripts
getmodulesGet cached ModuleScripts
getrunningscriptsGet all running scripts
getscriptbytecodeGet processed script bytecode
getscriptclosureGet a script's main function
getscriptfromthreadGet the script associated with a thread
getscriptthreadGet a thread associated with a script
getscripthashHash processed script bytecode
getscriptsGet cached client-visible scripts
getsenvGet a script's environment
isexecutorthreadCheck whether a thread belongs to Volt
loadstringCompile and load Luau code