# Table of Contents - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Release Notes](#volt-release-notes) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Release Notes](#volt-release-notes) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) - [Volt Documentation](#volt-documentation) --- # Volt Documentation Introduction ============ The official documentation for **Volt** The environment docs are heavily based on the [sUNC](https://sunc.su/) (senS' Unified Naming Convention) standard. Here you can find information about Volt's scripting environment and other general usage information. This documentation is subject to refactoring and may not remain exactly the same * * * [Explore the Docs](https://docs.voltbz.net/docs#explore-the-docs) ------------------------------------------------------------------ [### Closures\ \ Inspect, modify and create Luau closures with precise control.](https://docs.voltbz.net/docs/closures) [### Debug\ \ Access debug library functions for runtime inspection.](https://docs.voltbz.net/docs/debug) [### Decompiler\ \ Learn how Volt turns Luau bytecode into readable source.](https://docs.voltbz.net/docs/decompiler) [### Drawing\ \ Create and manage drawing objects for visual overlays.](https://docs.voltbz.net/docs/drawing) [### Encoding\ \ Encode and decode data in various formats.](https://docs.voltbz.net/docs/encoding) [### Environment\ \ Access and manipulate the Luau environment.](https://docs.voltbz.net/docs/environment) [### Filesystem\ \ Read, write, and manage files on the local system.](https://docs.voltbz.net/docs/filesystem) [### Instances\ \ Interact with game instances in special ways.](https://docs.voltbz.net/docs/instances) [### Metatable\ \ Work with metatables and metamethods.](https://docs.voltbz.net/docs/metatable) [### Miscellaneous\ \ Various utility functions.](https://docs.voltbz.net/docs/miscellaneous) [### oth\ \ Secure thread-based function hooking for C functions.](https://docs.voltbz.net/docs/oth) [### Reflection\ \ Access hidden properties and thread identity.](https://docs.voltbz.net/docs/reflection) [### Scripts\ \ Interact with running scripts and modules.](https://docs.voltbz.net/docs/scripts) [### Signals\ \ Fire and manage game signals.](https://docs.voltbz.net/docs/signals) [### VoltSignal\ \ Custom signal implementation for events.](https://docs.voltbz.net/docs/voltsignal) [### LuaStateProxy\ \ Proxy object for Lua states.](https://docs.voltbz.net/docs/luastateproxy) [### WebSocket\ \ Create WebSocket connections for real-time communication.](https://docs.voltbz.net/docs/websocket) [### RakNet\ \ Inspect, modify, block, and send low-level game packets.](https://docs.voltbz.net/docs/raknet) [Account Manager\ \ Store multiple accounts and launch the game with any of them, including multi-instance launching, auto-relaunch, groups, private servers, and live monitoring.](https://docs.voltbz.net/docs/account-manager) ### On this page [Explore the Docs](https://docs.voltbz.net/docs#explore-the-docs) --- # Volt Documentation Account Manager =============== Store multiple accounts and launch the game with any of them, including multi-instance launching, auto-relaunch, groups, private servers, and live monitoring. The **Account Manager** is a built-in panel for storing multiple accounts and launching the game with any of them, without signing in by hand every time. Each account is added once by capturing its login session, which Volt stores **locally and encrypted**. From there you can launch one or many accounts at once, point them at a specific place or private server, automatically restart crashed instances, watch each instance's live CPU, memory and connection status, and organize everything into groups. Launching, browser login and live process stats are **Windows-only**. Your accounts never leave your machine. See [Storage and security](https://docs.voltbz.net/docs/account-manager) . [Opening the Account Manager](https://docs.voltbz.net/docs/account-manager#opening-the-account-manager) -------------------------------------------------------------------------------------------------------- * **Activity bar**: click the **Account Manager** item (people icon) on the side rail. * **Command palette**: search for **"Account Manager: Open"**. * Keep it docked in the main window, or use **Dock / Overlay** to pop it out into its own window or a compact always-on-top monitor. [Adding accounts](https://docs.voltbz.net/docs/account-manager#adding-accounts) -------------------------------------------------------------------------------- There are three ways to add accounts. However you add them, Volt fetches each account's identity (username and display name), confirms the session is valid, then encrypts and stores it. Accounts are de-duplicated automatically, so re-adding an existing one simply updates it. After importing, a summary reports how many accounts were **imported**, **updated**, and **failed** (with a reason for each failure). ### [Log in from a browser (recommended)](https://docs.voltbz.net/docs/account-manager#log-in-from-a-browser-recommended) Click **Login from Browser**. Volt opens Microsoft Edge or Google Chrome in a throwaway profile on the platform's login page. Sign in as you normally would. Volt detects the session automatically, imports the account, and closes the browser for you. Use **Cancel** to stop at any time. (Requires Edge or Chrome installed.) ### [Paste sessions](https://docs.voltbz.net/docs/account-manager#paste-sessions) Click **Paste Cookies**, paste one session token per line, and click **Import**. Handy for bulk-adding accounts you already have. ### [Load from a file](https://docs.voltbz.net/docs/account-manager#load-from-a-file) Click **Load from File** and pick one or more `.txt` / `.csv` / `.log` files. Their contents are merged into the paste box for review, then imported the same way. [Launching](https://docs.voltbz.net/docs/account-manager#launching) -------------------------------------------------------------------- 1. In **Launch Settings**, enter a **Place ID** and wait for the green validation pill (it shows the resolved game name, creator and live player count), or choose a [private server](https://docs.voltbz.net/docs/account-manager) . 2. Tick the account(s) you want in the table. 3. Click **Launch Selected**. Volt launches each selected account in turn, waiting the **Launch delay** (default 5s, range 0 to 120s) between each so clients don't all start at once. The **Connection** column moves from _Connecting_ to _Connected_ as each client attaches, and live CPU and memory fill in. Running more than one client at a time needs Volt's global **Multi-Instance** setting enabled. If it's off, the panel prompts you with a shortcut to turn it on. To relaunch a single account immediately (skipping the delay), use the circular-arrow button on its row. To close running clients, select the accounts and click **Stop**. [Auto-relaunch](https://docs.voltbz.net/docs/account-manager#auto-relaunch) ---------------------------------------------------------------------------- Enable **Auto-relaunch closed instances** to have Volt restart an account after its client exits unexpectedly. A background monitor watches the tracked processes and, after the **Relaunch delay** (default 5s, range 5 to 300s), relaunches the account; the row shows a live "Relaunching in Ns…" countdown. When you turn this on, Volt suggests enabling **Silent Errors** so crash dialogs don't block the relaunch. [Groups](https://docs.voltbz.net/docs/account-manager#groups) -------------------------------------------------------------- Groups let you run different sets of accounts with different settings. Each group carries its **own** full launch configuration (place ID, delays, auto-relaunch, private-server mode), so one group can target one place while another targets a different one. * **Add group**, **rename**, or **remove** from the **Launch Settings** group dropdown. * **Assign accounts** with the per-row group dropdown, or select several and use **Set group** in the Accounts header. The accounts table is split into sections per group (plus an _Ungrouped_ section) with counts. [Private servers](https://docs.voltbz.net/docs/account-manager#private-servers) -------------------------------------------------------------------------------- Open the **mode selector** in Launch Settings: * **None**: launch straight into the place ID. * **Round-robin**: spread launched accounts across a pool of private servers. * **Assigned**: each account uses the private server assigned to it (per-row dropdown). Add servers under **Advanced Private Servers**: give each a name, place ID, and a private link or code. Volt resolves the link to the place at launch time and caches the result. [Health checks](https://docs.voltbz.net/docs/account-manager#health-checks) ---------------------------------------------------------------------------- Click **Check Health** (or **Check** on a selection) to test whether each stored session is still valid. Every account shows an **alive**, **dead**, or **unknown** badge, along with when it was last checked. [Monitoring](https://docs.voltbz.net/docs/account-manager#monitoring) ---------------------------------------------------------------------- * **Header summary**: totals for accounts, connected, connecting, relaunching, total memory, total CPU, and alive/dead counts. * **Per row**: session health, **Connection** state (Idle / Connecting / Connected / Relaunching), committed **Memory**, **CPU**, assigned private server, and last-launch time. * **Performance overlay**: click **Overlay** for a small always-on-top window that refreshes every few seconds with connected/total, process count, memory, CPU and a per-account list. A corner dropdown (Top / Bottom × Left / Right) tiles it to your screen; opening it hibernates Volt's other windows to save resources. * **Recent Activity**: a live, timestamped log of launches, connections, closes, relaunches, imports and errors. Launch settings, groups and private servers **autosave** a couple of seconds after you change them (and before every launch); per-account edits save immediately. [Account data](https://docs.voltbz.net/docs/account-manager#account-data) -------------------------------------------------------------------------- Each account stores: | Field | Description | | --- | --- | | Username / Display name | Pulled from the platform when the account is added | | Alias | Your own nickname for the account (shown first when set) | | Group | Which group the account belongs to | | Notes | Free-text notes | | Session status | `alive` / `dead` / `unknown`, from the last health check | | Auto-relaunch | Whether this account is included in auto-relaunch | | Assigned private server | Used in _Assigned_ mode | | Last checked / Last launched | Timestamps | | Live usage | PID, committed memory, CPU and connection state while running | The login session itself is stored **encrypted** and is never shown in the interface. [Storage and security](https://docs.voltbz.net/docs/account-manager#storage-and-security) ------------------------------------------------------------------------------------------ * **Local only.** Accounts, sessions, settings, groups and private servers live in a single `account-manager.json` file in Volt's app-data folder. Nothing about your accounts is sent to Volt's servers. The only network calls go directly to the platform (to fetch identity, auth tickets and resolve places) and to your local browser during browser login. * **Encrypted at rest.** On Windows, sessions are encrypted with the operating system's data-protection API (DPAPI) and tied to your Windows user, so the file can't be read on another machine or account. The decrypted session never reaches the interface. * **Windows-only actions.** Launching, browser login, stopping/tracking clients and live CPU all require Windows; on other platforms those actions are unavailable. * **Multi-Instance.** Running multiple clients depends on Volt's Multi-Instance setting being enabled. [Quick start](https://docs.voltbz.net/docs/account-manager#quick-start) ------------------------------------------------------------------------ 1. Open the Account Manager and click **Login from Browser**, then sign in. The account imports automatically. 2. Enter a **Place ID** in Launch Settings and wait for the green pill. 3. Tick the account and click **Launch Selected**. 4. To run several at once, enable **Multi-Instance** when prompted, set a **Launch delay**, turn on **Auto-relaunch**, then select all and launch. [Introduction\ \ Previous Page](https://docs.voltbz.net/docs) [Decompiler\ \ Next Page](https://docs.voltbz.net/docs/decompiler) ### On this page [Opening the Account Manager](https://docs.voltbz.net/docs/account-manager#opening-the-account-manager) [Adding accounts](https://docs.voltbz.net/docs/account-manager#adding-accounts) [Log in from a browser (recommended)](https://docs.voltbz.net/docs/account-manager#log-in-from-a-browser-recommended) [Paste sessions](https://docs.voltbz.net/docs/account-manager#paste-sessions) [Load from a file](https://docs.voltbz.net/docs/account-manager#load-from-a-file) [Launching](https://docs.voltbz.net/docs/account-manager#launching) [Auto-relaunch](https://docs.voltbz.net/docs/account-manager#auto-relaunch) [Groups](https://docs.voltbz.net/docs/account-manager#groups) [Private servers](https://docs.voltbz.net/docs/account-manager#private-servers) [Health checks](https://docs.voltbz.net/docs/account-manager#health-checks) [Monitoring](https://docs.voltbz.net/docs/account-manager#monitoring) [Account data](https://docs.voltbz.net/docs/account-manager#account-data) [Storage and security](https://docs.voltbz.net/docs/account-manager#storage-and-security) [Quick start](https://docs.voltbz.net/docs/account-manager#quick-start) --- # Volt Documentation Closures ======== The **Closures** library allows for viewing info about a closures origin and allowing the manipulation of said closure. [Overview](https://docs.voltbz.net/docs/closures#overview) ----------------------------------------------------------- This library provides tools to: * **Inspect** closures to determine their type and origin * **Modify** closures by hooking or replacing them * **Create** new closures with specific properties [Available Functions](https://docs.voltbz.net/docs/closures#available-functions) --------------------------------------------------------------------------------- | Function | Description | | --- | --- | | [`checkcaller`](https://docs.voltbz.net/docs/closures/checkcaller) | Check if the current call is from Volt | | [`clonefunction`](https://docs.voltbz.net/docs/closures/clonefunction) | Create a copy of a function | | [`getfunctionhash`](https://docs.voltbz.net/docs/closures/getfunctionhash) | Get the hash of a function's bytecode | | [`hookfunction`](https://docs.voltbz.net/docs/closures/hookfunction) | Replace a function with another | | [`hookmetamethod`](https://docs.voltbz.net/docs/closures/hookmetamethod) | Hook a metatable metamethod | | [`iscclosure`](https://docs.voltbz.net/docs/closures/iscclosure) | Check if a function is a C closure | | [`isexecutorclosure`](https://docs.voltbz.net/docs/closures/isexecutorclosure) | Check if a function is from Volt | | [`isfunctionhooked`](https://docs.voltbz.net/docs/closures/isfunctionhooked) | Check if a function has been hooked | | [`islclosure`](https://docs.voltbz.net/docs/closures/islclosure) | Check if a function is a Luau closure | | [`isnewcclosure`](https://docs.voltbz.net/docs/closures/isnewcclosure) | Check if a function is a newcclosure | | [`newcclosure`](https://docs.voltbz.net/docs/closures/newcclosure) | Wrap a Luau function as a C closure | | [`newlclosure`](https://docs.voltbz.net/docs/closures/newlclosure) | Wrap a C closure as a Luau closure | | [`restorefunction`](https://docs.voltbz.net/docs/closures/restorefunction) | Restore a hooked function to its original | | [`setstackhidden`](https://docs.voltbz.net/docs/closures/setstackhidden) | Hide a function from stack traces | [Closure Types](https://docs.voltbz.net/docs/closures#closure-types) --------------------------------------------------------------------- There are two main types of closures: ### [C Closures](https://docs.voltbz.net/docs/closures#c-closures) Functions implemented in C/C++. These are typically: * Built-in Luau functions like `print`, `type` * Game API methods * Majority of custom functions ### [Luau Closures](https://docs.voltbz.net/docs/closures#luau-closures) Functions written in Luau. These are typically: * User-defined functions * Game Script functions [Decompiler\ \ Previous Page](https://docs.voltbz.net/docs/decompiler) [checkcaller\ \ Next Page](https://docs.voltbz.net/docs/closures/checkcaller) ### On this page [Overview](https://docs.voltbz.net/docs/closures#overview) [Available Functions](https://docs.voltbz.net/docs/closures#available-functions) [Closure Types](https://docs.voltbz.net/docs/closures#closure-types) [C Closures](https://docs.voltbz.net/docs/closures#c-closures) [Luau Closures](https://docs.voltbz.net/docs/closures#luau-closures) --- # Volt Documentation Debug ===== The **Debug** library provides functions for runtime inspection of Luau functions, including access to constants, upvalues, protos, and stack values. The functions added by Volt to the `debug` table are also registered as same-named globals, such as `getconstant`, `getinfo`, and `setstack`. `debug.validlevel` additionally has the `debug.isvalidlevel` alias; both `validlevel` and `isvalidlevel` are globals. [Overview](https://docs.voltbz.net/docs/debug#overview) -------------------------------------------------------- These functions allow you to: * **Inspect** function internals (constants, upvalues, protos) * **Modify** function behavior at runtime * **Access** the call stack [Available Functions](https://docs.voltbz.net/docs/debug#available-functions) ------------------------------------------------------------------------------ | Function | Description | | --- | --- | | [`debug.getcallstack`](https://docs.voltbz.net/docs/debug/getcallstack) | Get the current call stack | | [`debug.getconstant`](https://docs.voltbz.net/docs/debug/getconstant) | Get a constant from a function | | [`debug.getconstants`](https://docs.voltbz.net/docs/debug/getconstants) | Get all constants from a function | | [`debug.getinfo`](https://docs.voltbz.net/docs/debug/getinfo) | Get information about a function | | [`debug.getproto`](https://docs.voltbz.net/docs/debug/getproto) | Get a proto (nested function) from a function | | [`debug.getprotos`](https://docs.voltbz.net/docs/debug/getprotos) | Get all protos from a function | | [`debug.getstack`](https://docs.voltbz.net/docs/debug/getstack) | Get a value from the stack | | [`debug.getupvalue`](https://docs.voltbz.net/docs/debug/getupvalue) | Get an upvalue from a function | | [`debug.getupvalues`](https://docs.voltbz.net/docs/debug/getupvalues) | Get all upvalues from a function | | [`debug.setconstant`](https://docs.voltbz.net/docs/debug/setconstant) | Set a constant in a function | | [`debug.setinfo`](https://docs.voltbz.net/docs/debug/setinfo) | Change function debug metadata | | [`debug.setstack`](https://docs.voltbz.net/docs/debug/setstack) | Set a value on the stack | | [`debug.setupvalue`](https://docs.voltbz.net/docs/debug/setupvalue) | Set an upvalue in a function | | [`debug.validlevel`](https://docs.voltbz.net/docs/debug/validlevel) | Check if a stack level is valid | | [`ProtoProxy`](https://docs.voltbz.net/docs/debug/protoproxy) | Inspect a nested prototype | [Terminology](https://docs.voltbz.net/docs/debug#terminology) -------------------------------------------------------------- ### [Constants](https://docs.voltbz.net/docs/debug#constants) Values embedded directly in the function's bytecode. These include: * String literals * Numbers * Booleans * `nil` ### [Upvalues](https://docs.voltbz.net/docs/debug#upvalues) Variables captured from the enclosing scope. When a function references a variable from outside its own scope, that variable becomes an upvalue. ### [Protos](https://docs.voltbz.net/docs/debug#protos) Nested function definitions within a function. These are the "prototypes" of inner functions. ### [Stack](https://docs.voltbz.net/docs/debug#stack) The call stack containing local variables and temporary values for the current execution context. [setstackhidden\ \ Previous Page](https://docs.voltbz.net/docs/closures/setstackhidden) [debug.getcallstack\ \ Next Page](https://docs.voltbz.net/docs/debug/getcallstack) ### On this page [Overview](https://docs.voltbz.net/docs/debug#overview) [Available Functions](https://docs.voltbz.net/docs/debug#available-functions) [Terminology](https://docs.voltbz.net/docs/debug#terminology) [Constants](https://docs.voltbz.net/docs/debug#constants) [Upvalues](https://docs.voltbz.net/docs/debug#upvalues) [Protos](https://docs.voltbz.net/docs/debug#protos) [Stack](https://docs.voltbz.net/docs/debug#stack) --- # Volt Documentation Environment =========== The **Environment** library provides functions for accessing and manipulating the Luau environment, including garbage collection inspection and global environments. [Overview](https://docs.voltbz.net/docs/environment#overview) -------------------------------------------------------------- These functions allow you to: * Access different global environments * Inspect the garbage collector * Filter and find objects in memory [Available Functions](https://docs.voltbz.net/docs/environment#available-functions) ------------------------------------------------------------------------------------ | Function | Description | | --- | --- | | [`filtergc`](https://docs.voltbz.net/docs/environment/filtergc) | Filter garbage collected objects | | [`getallthreads`](https://docs.voltbz.net/docs/environment/getallthreads) | Get GC-visible Luau threads | | [`getgc`](https://docs.voltbz.net/docs/environment/getgc) | Get all objects tracked by garbage collector | | [`getgenv`](https://docs.voltbz.net/docs/environment/getgenv) | Get Volt's global environment | | [`getreg`](https://docs.voltbz.net/docs/environment/getreg) | Get the Luau registry | | [`getrenv`](https://docs.voltbz.net/docs/environment/getrenv) | Get the game's global environment | | [`gettenv`](https://docs.voltbz.net/docs/environment/gettenv) | Get a thread's environment | [Environment Types](https://docs.voltbz.net/docs/environment#environment-types) -------------------------------------------------------------------------------- ### [Volt Environment (genv)](https://docs.voltbz.net/docs/environment#volt-environment-genv) The global environment where your scripts run. Variables defined here persist across script executions. ### [Game Environment (renv)](https://docs.voltbz.net/docs/environment#game-environment-renv) The game's Luau environment containing globals such as `game` and `workspace`. ### [Registry](https://docs.voltbz.net/docs/environment#registry) The Luau registry is a special table used internally by the Luau implementation to store references. [setreadonly\ \ Previous Page](https://docs.voltbz.net/docs/metatable/setreadonly) [filtergc\ \ Next Page](https://docs.voltbz.net/docs/environment/filtergc) ### On this page [Overview](https://docs.voltbz.net/docs/environment#overview) [Available Functions](https://docs.voltbz.net/docs/environment#available-functions) [Environment Types](https://docs.voltbz.net/docs/environment#environment-types) [Volt Environment (genv)](https://docs.voltbz.net/docs/environment#volt-environment-genv) [Game Environment (renv)](https://docs.voltbz.net/docs/environment#game-environment-renv) [Registry](https://docs.voltbz.net/docs/environment#registry) --- # Volt Documentation Miscellaneous ============= The **Miscellaneous** library contains various utility functions that don't fit into other categories. [Available Functions](https://docs.voltbz.net/docs/miscellaneous#available-functions) -------------------------------------------------------------------------------------- | Function | Description | | --- | --- | | [`clearqueueonteleport`](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport) | Clear the teleport script queue | | [`getfflag`](https://docs.voltbz.net/docs/miscellaneous/getfflag) | Get a Fast Flag value | | [`getfpscap`](https://docs.voltbz.net/docs/miscellaneous/getfpscap) | Get current FPS cap | | [`gethwid`](https://docs.voltbz.net/docs/miscellaneous/gethwid) | Get Volt's external identifier | | [`get_process_identifier`](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier) | Get the game process ID | | [`identifyexecutor`](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor) | Get Volt's name and version | | [`messagebox`](https://docs.voltbz.net/docs/miscellaneous/messagebox) | Display a message box | | [`queueonteleport`](https://docs.voltbz.net/docs/miscellaneous/queueonteleport) | Queue script for after teleport | | [`request`](https://docs.voltbz.net/docs/miscellaneous/request) | Make HTTP requests | | [`saveinstance`](https://docs.voltbz.net/docs/miscellaneous/saveinstance) | Save instance to file | | [`saveplace`](https://docs.voltbz.net/docs/miscellaneous/saveplace) | Save the current place | | [`setclipboard`](https://docs.voltbz.net/docs/miscellaneous/setclipboard) | Copy text to clipboard | | [`setrbxclipboard`](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard) | Copy to the Studio clipboard | | [`setfflag`](https://docs.voltbz.net/docs/miscellaneous/setfflag) | Set a Fast Flag value | | [`setfpscap`](https://docs.voltbz.net/docs/miscellaneous/setfpscap) | Set FPS cap | [lz4decompress\ \ Previous Page](https://docs.voltbz.net/docs/encoding/lz4decompress) [clearqueueonteleport\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport) ### On this page [Available Functions](https://docs.voltbz.net/docs/miscellaneous#available-functions) --- # Volt Release Notes Release Notes ============= Major Volt releases in one place. Each release note keeps the important changes, upgrade context, and compatibility notes easy to scan. [### Volt 1.3\ \ Featuring a custom decompiler, built-in saveinstance, native game explorer, script viewer, account manager, and much more.](https://docs.voltbz.net/docs/releases/1.3) [Volt 1.3\ \ Volt 1.3 adds UI 1.0, Account Manager, Game Explorer, Script Viewer, Save Instance, and the Luau decompiler.](https://docs.voltbz.net/docs/releases/1.3) --- # Volt Documentation Decompiler ========== Volt's decompiler turns Luau bytecode back into readable Luau source. The most important thing to know as a user is that decompilation runs asynchronously: calls that need source can yield while the decompiler works in the background, then resume when the result is ready. That behavior matters most for saves, where one operation may need source for many scripts before the final file can be written. [How It Works](https://docs.voltbz.net/docs/decompiler#how-it-works) --------------------------------------------------------------------- The decompiler work is scheduled as jobs. The Luau-facing operation yields while those jobs run, so long decompiles do not block the calling script thread. Scheduler queue Worker threads Call starts Results script A script B script C ... Thread 1script A Thread 2script B Thread 3script C The decompiler scheduler will configure itself automatically based on the number of available CPU cores. When these threads are not used, they are in a dormant state and don't utilize any CPU time. [`decompile`](https://docs.voltbz.net/docs/scripts/decompile) schedules one script and yields until the source is ready. [`saveinstance`](https://docs.voltbz.net/docs/miscellaneous/saveinstance) and [`saveplace`](https://docs.voltbz.net/docs/miscellaneous/saveplace) can schedule many scripts during a save, wait for the results, then finish writing the final place or model file. [The Pipeline](https://docs.voltbz.net/docs/decompiler#the-pipeline) --------------------------------------------------------------------- This section explains how Volt's decompiler pipeline works, how each option changes the output, and what those choices mean for performance. Volt prioritizes semantic correctness over raw speed. It is still fast, but it may take longer than some alternatives. In return, it can decompile scripts with 100k+ lines while preserving behavior close to the original source. Bytecode Build CFG SSA passessimplify valuestidy logicremove extras Flatten CFG AST passesshape codeclean if/elsename variablespolish output Format Source The diagram gives a simplified view of how Volt turns script bytecode into readable Luau source. First, the bytecode is lifted into Volt's internal IR, or [intermediate representation](https://en.wikipedia.org/wiki/Intermediate_representation) . This IR uses [SSA form](https://en.wikipedia.org/wiki/Static_single-assignment_form) , where each temporary value is assigned once, and a [CFG](https://en.wikipedia.org/wiki/Control-flow_graph) , which maps the blocks of code and the jumps between them. From there, the SSA pass pipeline simplifies the IR and removes unnecessary noise. Once the IR is clean enough, the CFG is lowered into a linear [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) . The AST is a tree-shaped representation of the code that is much closer to real source. Finally, more AST passes clean up the structure, remove artifacts, and improve readability before the result is formatted and printed as Luau source code. ### [Options and Tradeoffs](https://docs.voltbz.net/docs/decompiler#options-and-tradeoffs) Volt exposes SSA and AST pass controls through the `DecompilerOptions` type. These pass groups run at different stages of the pipeline, so you may want to toggle them for different reasons depending on whether you care more about speed, correctness, or readability. #### [SSA Passes](https://docs.voltbz.net/docs/decompiler#ssa-passes) As of this writing, the only configurable SSA pass is the `DecompilerOptions.ConditionalStructurer` pass. This pass rewrites certain `if` and `else` control-flow patterns into equivalent `and` / `or` expressions. The output behaves the same, but it is often easier to read. The pass is relatively fast, even on large scripts, but it is not required for semantic correctness. Turning it off can noticeably reduce decompilation time on some scripts. #### [AST Passes](https://docs.voltbz.net/docs/decompiler#ast-passes) Most AST passes are worth leaving enabled. Passes like `SmartVariableRenamer`, `FunctionDeclarations`, and `GuardClauses` are very cheap and usually make the output much easier to read. The main AST setting worth tuning is `DoBlockInsertionThreshold`. This controls when Volt wraps a region in a `do ... end` block to keep the number of live locals under Luau's limit. You usually only need this when you want the decompiled script to compile again. If your goal is readability or analysis, setting the threshold to `0` disables this pass, which can make the output cleaner and slightly reduce decompilation time. #### [Formatting](https://docs.voltbz.net/docs/decompiler#formatting) Formatting is mostly a matter of preference. The formatter has a negligible performance cost, taking about 30ms on a script with 100k lines of code. Volt exposes formatter settings through [`DecompilerFormatter`](https://docs.voltbz.net/docs/scripts/decompile#decompilerformatter) . See that API reference page for the full list of formatting options. [Related Reference](https://docs.voltbz.net/docs/decompiler#related-reference) ------------------------------------------------------------------------------- * [`decompile`](https://docs.voltbz.net/docs/scripts/decompile) , [`DecompilerOptions`](https://docs.voltbz.net/docs/scripts/decompile#decompileroptions) , [`DecompilerFormatter`](https://docs.voltbz.net/docs/scripts/decompile#decompilerformatter) * [`saveinstance`](https://docs.voltbz.net/docs/miscellaneous/saveinstance) * [`saveplace`](https://docs.voltbz.net/docs/miscellaneous/saveplace) [Account Manager\ \ Store multiple accounts and launch the game with any of them, including multi-instance launching, auto-relaunch, groups, private servers, and live monitoring.](https://docs.voltbz.net/docs/account-manager) [Closures\ \ Next Page](https://docs.voltbz.net/docs/closures) ### On this page [How It Works](https://docs.voltbz.net/docs/decompiler#how-it-works) [The Pipeline](https://docs.voltbz.net/docs/decompiler#the-pipeline) [Options and Tradeoffs](https://docs.voltbz.net/docs/decompiler#options-and-tradeoffs) [SSA Passes](https://docs.voltbz.net/docs/decompiler#ssa-passes) [AST Passes](https://docs.voltbz.net/docs/decompiler#ast-passes) [Formatting](https://docs.voltbz.net/docs/decompiler#formatting) [Related Reference](https://docs.voltbz.net/docs/decompiler#related-reference) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) getfunctionhash =============== Returns a hash of the function's bytecode. [Syntax](https://docs.voltbz.net/docs/closures/getfunctionhash#syntax) ----------------------------------------------------------------------- getfunctionhash(func: function) -> string [Parameters](https://docs.voltbz.net/docs/closures/getfunctionhash#parameters) ------------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The function to hash | [Returns](https://docs.voltbz.net/docs/closures/getfunctionhash#returns) ------------------------------------------------------------------------- | Type | Description | | --- | --- | | `string` | A 96-character hexadecimal SHA-384 digest | [Description](https://docs.voltbz.net/docs/closures/getfunctionhash#description) --------------------------------------------------------------------------------- `getfunctionhash` computes a SHA-384 digest over a Luau closure's instructions and constants. It throws for C closures, which have no Luau bytecode to hash. [Example](https://docs.voltbz.net/docs/closures/getfunctionhash#example) ------------------------------------------------------------------------- local function isSha384Hex(hash) return #hash == 96 and hash:match("^[0-9a-fA-F]+$") ~= nil end local function first() return "constant" end local function second() return "different constant" end local firstHash = getfunctionhash(first) local secondHash = getfunctionhash(second) print(isSha384Hex(firstHash)) -- true print(firstHash == secondHash) -- false [Notes](https://docs.voltbz.net/docs/closures/getfunctionhash#notes) --------------------------------------------------------------------- * Only works with Luau closures; C closures throw an error * Slight changes in function bytecode will alter the returned hash [clonefunction\ \ Previous Page](https://docs.voltbz.net/docs/closures/clonefunction) [hookfunction\ \ Next Page](https://docs.voltbz.net/docs/closures/hookfunction) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/getfunctionhash#syntax) [Parameters](https://docs.voltbz.net/docs/closures/getfunctionhash#parameters) [Returns](https://docs.voltbz.net/docs/closures/getfunctionhash#returns) [Description](https://docs.voltbz.net/docs/closures/getfunctionhash#description) [Example](https://docs.voltbz.net/docs/closures/getfunctionhash#example) [Notes](https://docs.voltbz.net/docs/closures/getfunctionhash#notes) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) isfunctionhooked ================ Checks if a function has been hooked. [Syntax](https://docs.voltbz.net/docs/closures/isfunctionhooked#syntax) ------------------------------------------------------------------------ isfunctionhooked(func: function) -> boolean [Parameters](https://docs.voltbz.net/docs/closures/isfunctionhooked#parameters) -------------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The function to check | [Returns](https://docs.voltbz.net/docs/closures/isfunctionhooked#returns) -------------------------------------------------------------------------- | Type | Description | | --- | --- | | `boolean` | True if the function is hooked | [Description](https://docs.voltbz.net/docs/closures/isfunctionhooked#description) ---------------------------------------------------------------------------------- `isfunctionhooked` checks whether a function has been replaced using `hookfunction` or similar hooking methods. [Example](https://docs.voltbz.net/docs/closures/isfunctionhooked#example) -------------------------------------------------------------------------- local function myFunc() return "original" end print(isfunctionhooked(myFunc)) -- false hookfunction(myFunc, function() return "hooked" end) print(isfunctionhooked(myFunc)) -- true [Use Cases](https://docs.voltbz.net/docs/closures/isfunctionhooked#use-cases) ------------------------------------------------------------------------------ * Checking if a function has already been hooked * Avoiding double-hooking * Debugging hook states [Related Functions](https://docs.voltbz.net/docs/closures/isfunctionhooked#related-functions) ---------------------------------------------------------------------------------------------- * [`hookfunction`](https://docs.voltbz.net/docs/closures/hookfunction) - Hook a function * [`restorefunction`](https://docs.voltbz.net/docs/closures/restorefunction) - Restore original [isexecutorclosure\ \ Previous Page](https://docs.voltbz.net/docs/closures/isexecutorclosure) [islclosure\ \ Next Page](https://docs.voltbz.net/docs/closures/islclosure) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/isfunctionhooked#syntax) [Parameters](https://docs.voltbz.net/docs/closures/isfunctionhooked#parameters) [Returns](https://docs.voltbz.net/docs/closures/isfunctionhooked#returns) [Description](https://docs.voltbz.net/docs/closures/isfunctionhooked#description) [Example](https://docs.voltbz.net/docs/closures/isfunctionhooked#example) [Use Cases](https://docs.voltbz.net/docs/closures/isfunctionhooked#use-cases) [Related Functions](https://docs.voltbz.net/docs/closures/isfunctionhooked#related-functions) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) hookfunction ============ Replaces a function with a custom implementation. [Syntax](https://docs.voltbz.net/docs/closures/hookfunction#syntax) -------------------------------------------------------------------- hookfunction(target: function, hook: function) -> function [Aliases](https://docs.voltbz.net/docs/closures/hookfunction#aliases) ---------------------------------------------------------------------- * `replaceclosure` * `hookfunc` [Parameters](https://docs.voltbz.net/docs/closures/hookfunction#parameters) ---------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `target` | `function` | The function to hook | | `hook` | `function` | The replacement function | [Returns](https://docs.voltbz.net/docs/closures/hookfunction#returns) ---------------------------------------------------------------------- | Type | Description | | --- | --- | | `function` | A reference to the original function | [Description](https://docs.voltbz.net/docs/closures/hookfunction#description) ------------------------------------------------------------------------------ `hookfunction` replaces the target function with your hook function. All calls to the original function will now go through your hook instead. The function returns a reference to the original, allowing you to call it from within your hook. [Example](https://docs.voltbz.net/docs/closures/hookfunction#example) ---------------------------------------------------------------------- -- Hook the print function local originalPrint = hookfunction(print, function(...) originalPrint("[PREFIX]", ...) end) print("Hello") -- Output: [PREFIX] Hello -- You can still use the original originalPrint("Direct call") -- Output: Direct call [Advanced Example](https://docs.voltbz.net/docs/closures/hookfunction#advanced-example) ---------------------------------------------------------------------------------------- -- Hook a game method local oldNamecall oldNamecall = hookfunction( getrawmetatable(game).__namecall, newcclosure(function(self, ...) local method = getnamecallmethod() if method == "Kick" then return -- Block kick end return oldNamecall(self, ...) end) ) [Notes](https://docs.voltbz.net/docs/closures/hookfunction#notes) ------------------------------------------------------------------ * Use `checkcaller` to differentiate between your calls and game calls * Automatically wrapps Luau hooks in `newcclosure` when hooking C closures * The returned original can be called to bypass the hook * Restore the hook with `restorefunction` [getfunctionhash\ \ Previous Page](https://docs.voltbz.net/docs/closures/getfunctionhash) [hookmetamethod\ \ Next Page](https://docs.voltbz.net/docs/closures/hookmetamethod) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/hookfunction#syntax) [Aliases](https://docs.voltbz.net/docs/closures/hookfunction#aliases) [Parameters](https://docs.voltbz.net/docs/closures/hookfunction#parameters) [Returns](https://docs.voltbz.net/docs/closures/hookfunction#returns) [Description](https://docs.voltbz.net/docs/closures/hookfunction#description) [Example](https://docs.voltbz.net/docs/closures/hookfunction#example) [Advanced Example](https://docs.voltbz.net/docs/closures/hookfunction#advanced-example) [Notes](https://docs.voltbz.net/docs/closures/hookfunction#notes) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) hookmetamethod ============== Hooks a metamethod on an object's metatable. [Syntax](https://docs.voltbz.net/docs/closures/hookmetamethod#syntax) ---------------------------------------------------------------------- hookmetamethod(object: any, metamethod: string, hook: function) -> function [Parameters](https://docs.voltbz.net/docs/closures/hookmetamethod#parameters) ------------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `object` | `any` | An object with the target metatable | | `metamethod` | `string` | The metamethod name (e.g., "\*\*index", "\*\*namecall") | | `hook` | `function` | The replacement function | [Returns](https://docs.voltbz.net/docs/closures/hookmetamethod#returns) ------------------------------------------------------------------------ | Type | Description | | --- | --- | | `function` | A reference to the original metamethod | [Description](https://docs.voltbz.net/docs/closures/hookmetamethod#description) -------------------------------------------------------------------------------- `hookmetamethod` replaces a metamethod in an object's metatable with your custom function. This is commonly used to intercept method calls, property accesses, and other metamethod operations on instances. [Example](https://docs.voltbz.net/docs/closures/hookmetamethod#example) ------------------------------------------------------------------------ -- Hook __namecall to intercept method calls local oldNamecall oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(self, ...) local method = getnamecallmethod() if method == "GetService" then print("GetService called with:", ...) end return oldNamecall(self, ...) end)) -- This triggers the hook local players = game:GetService("Players") [Common Metamethods](https://docs.voltbz.net/docs/closures/hookmetamethod#common-metamethods) ---------------------------------------------------------------------------------------------- | Metamethod | Triggered By | | --- | --- | | `__index` | Property reads (`obj.Property`) | | `__newindex` | Property writes (`obj.Property = value`) | | `__namecall` | Method calls (`obj:Method()`) | | `__tostring` | `tostring(obj)` | | `__eq` | Equality comparison (`obj1 == obj2`) | [Notes](https://docs.voltbz.net/docs/closures/hookmetamethod#notes) -------------------------------------------------------------------- * Automatically uses `newcclosure` when hooking metamethods on game objects * Use `getnamecallmethod` inside `__namecall` hooks to get the method name * Multiple objects may share the same metatable * Use `checkcaller` to filter Volt calls from game calls [hookfunction\ \ Previous Page](https://docs.voltbz.net/docs/closures/hookfunction) [iscclosure\ \ Next Page](https://docs.voltbz.net/docs/closures/iscclosure) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/hookmetamethod#syntax) [Parameters](https://docs.voltbz.net/docs/closures/hookmetamethod#parameters) [Returns](https://docs.voltbz.net/docs/closures/hookmetamethod#returns) [Description](https://docs.voltbz.net/docs/closures/hookmetamethod#description) [Example](https://docs.voltbz.net/docs/closures/hookmetamethod#example) [Common Metamethods](https://docs.voltbz.net/docs/closures/hookmetamethod#common-metamethods) [Notes](https://docs.voltbz.net/docs/closures/hookmetamethod#notes) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) isexecutorclosure ================= Checks if a function originates from Volt. [Syntax](https://docs.voltbz.net/docs/closures/isexecutorclosure#syntax) ------------------------------------------------------------------------- isexecutorclosure(func: function) -> boolean [Parameters](https://docs.voltbz.net/docs/closures/isexecutorclosure#parameters) --------------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The function to check | [Returns](https://docs.voltbz.net/docs/closures/isexecutorclosure#returns) --------------------------------------------------------------------------- | Type | Description | | --- | --- | | `boolean` | `true` if the function is from Volt, `false` otherwise | [Description](https://docs.voltbz.net/docs/closures/isexecutorclosure#description) ----------------------------------------------------------------------------------- `isexecutorclosure` determines whether a function was created by or is part of Volt's environment. This includes both Volt-provided functions (like `loadstring`, `hookfunction`) and functions defined in your scripts. [Example](https://docs.voltbz.net/docs/closures/isexecutorclosure#example) --------------------------------------------------------------------------- -- Volt functions return true print(isexecutorclosure(loadstring)) -- true print(isexecutorclosure(hookfunction)) -- true -- Your script functions return true local function myFunc() return "hello" end print(isexecutorclosure(myFunc)) -- true -- Game functions return false print(isexecutorclosure(print)) -- false print(isexecutorclosure(game.GetService)) -- false [Related Functions](https://docs.voltbz.net/docs/closures/isexecutorclosure#related-functions) ----------------------------------------------------------------------------------------------- * [`checkcaller`](https://docs.voltbz.net/docs/closures/checkcaller) - Check if the current call is from Volt's thread * [`iscclosure`](https://docs.voltbz.net/docs/closures/iscclosure) - Check if a function is a C closure * [`islclosure`](https://docs.voltbz.net/docs/closures/islclosure) - Check if a function is a Luau closure [Aliases](https://docs.voltbz.net/docs/closures/isexecutorclosure#aliases) --------------------------------------------------------------------------- * `checkclosure` * `isourclosure` [iscclosure\ \ Previous Page](https://docs.voltbz.net/docs/closures/iscclosure) [isfunctionhooked\ \ Next Page](https://docs.voltbz.net/docs/closures/isfunctionhooked) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/isexecutorclosure#syntax) [Parameters](https://docs.voltbz.net/docs/closures/isexecutorclosure#parameters) [Returns](https://docs.voltbz.net/docs/closures/isexecutorclosure#returns) [Description](https://docs.voltbz.net/docs/closures/isexecutorclosure#description) [Example](https://docs.voltbz.net/docs/closures/isexecutorclosure#example) [Related Functions](https://docs.voltbz.net/docs/closures/isexecutorclosure#related-functions) [Aliases](https://docs.voltbz.net/docs/closures/isexecutorclosure#aliases) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) iscclosure ========== Checks if a function is a C closure. [Syntax](https://docs.voltbz.net/docs/closures/iscclosure#syntax) ------------------------------------------------------------------ iscclosure(func: function) -> boolean [Parameters](https://docs.voltbz.net/docs/closures/iscclosure#parameters) -------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The function to check | [Returns](https://docs.voltbz.net/docs/closures/iscclosure#returns) -------------------------------------------------------------------- | Type | Description | | --- | --- | | `boolean` | `true` if the function is a C closure, `false` otherwise | [Description](https://docs.voltbz.net/docs/closures/iscclosure#description) ---------------------------------------------------------------------------- `iscclosure` returns whether the given function is implemented in C/C++ rather than Luau. C closures include built-in Luau functions, game API methods, and functions wrapped with `newcclosure`. [Example](https://docs.voltbz.net/docs/closures/iscclosure#example) -------------------------------------------------------------------- -- Built-in functions are C closures print(iscclosure(print)) -- true print(iscclosure(type)) -- true print(iscclosure(game.GetService)) -- true -- User-defined functions are Luau closures local function myFunc() return "hello" end print(iscclosure(myFunc)) -- false -- Wrapped functions become C closures local wrapped = newcclosure(myFunc) print(iscclosure(wrapped)) -- true [Related Functions](https://docs.voltbz.net/docs/closures/iscclosure#related-functions) ---------------------------------------------------------------------------------------- * [`islclosure`](https://docs.voltbz.net/docs/closures/islclosure) - Check if a function is a Luau closure * [`newcclosure`](https://docs.voltbz.net/docs/closures/newcclosure) - Wrap a Luau function as a C closure [hookmetamethod\ \ Previous Page](https://docs.voltbz.net/docs/closures/hookmetamethod) [isexecutorclosure\ \ Next Page](https://docs.voltbz.net/docs/closures/isexecutorclosure) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/iscclosure#syntax) [Parameters](https://docs.voltbz.net/docs/closures/iscclosure#parameters) [Returns](https://docs.voltbz.net/docs/closures/iscclosure#returns) [Description](https://docs.voltbz.net/docs/closures/iscclosure#description) [Example](https://docs.voltbz.net/docs/closures/iscclosure#example) [Related Functions](https://docs.voltbz.net/docs/closures/iscclosure#related-functions) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) restorefunction =============== Restores a hooked function to its original implementation. [Syntax](https://docs.voltbz.net/docs/closures/restorefunction#syntax) ----------------------------------------------------------------------- restorefunction(func: function) -> () [Parameters](https://docs.voltbz.net/docs/closures/restorefunction#parameters) ------------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The hooked function to restore | [Returns](https://docs.voltbz.net/docs/closures/restorefunction#returns) ------------------------------------------------------------------------- This function does not return a value. [Description](https://docs.voltbz.net/docs/closures/restorefunction#description) --------------------------------------------------------------------------------- `restorefunction` removes a hook from a function, restoring it to its original behavior. This is useful for cleanup or when you need to temporarily remove a hook. [Example](https://docs.voltbz.net/docs/closures/restorefunction#example) ------------------------------------------------------------------------- -- Hook print local originalPrint = hookfunction(print, function(...) originalPrint("[HOOKED]", ...) end) print("Test 1") -- Output: [HOOKED] Test 1 -- Restore the original restorefunction(print) print("Test 2") -- Output: Test 2 (no prefix) [Notes](https://docs.voltbz.net/docs/closures/restorefunction#notes) --------------------------------------------------------------------- * Only works on functions that were hooked by Volt * Has no effect on functions that aren't currently hooked * The original function reference from `hookfunction` remains valid [Aliases](https://docs.voltbz.net/docs/closures/restorefunction#aliases) ------------------------------------------------------------------------- * `restorefunc` [newlclosure\ \ Previous Page](https://docs.voltbz.net/docs/closures/newlclosure) [setstackhidden\ \ Next Page](https://docs.voltbz.net/docs/closures/setstackhidden) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/restorefunction#syntax) [Parameters](https://docs.voltbz.net/docs/closures/restorefunction#parameters) [Returns](https://docs.voltbz.net/docs/closures/restorefunction#returns) [Description](https://docs.voltbz.net/docs/closures/restorefunction#description) [Example](https://docs.voltbz.net/docs/closures/restorefunction#example) [Notes](https://docs.voltbz.net/docs/closures/restorefunction#notes) [Aliases](https://docs.voltbz.net/docs/closures/restorefunction#aliases) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) isnewcclosure ============= Checks if a function is a newcclosure wrapper. [Syntax](https://docs.voltbz.net/docs/closures/isnewcclosure#syntax) --------------------------------------------------------------------- isnewcclosure(func: function) -> boolean [Aliases](https://docs.voltbz.net/docs/closures/isnewcclosure#aliases) ----------------------------------------------------------------------- * `iscustomcclosure` [Parameters](https://docs.voltbz.net/docs/closures/isnewcclosure#parameters) ----------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The function to check | [Returns](https://docs.voltbz.net/docs/closures/isnewcclosure#returns) ----------------------------------------------------------------------- | Type | Description | | --- | --- | | `boolean` | True if function was created by newcclosure | [Description](https://docs.voltbz.net/docs/closures/isnewcclosure#description) ------------------------------------------------------------------------------- `isnewcclosure` checks whether a function was wrapped using `newcclosure`. [Example](https://docs.voltbz.net/docs/closures/isnewcclosure#example) ----------------------------------------------------------------------- local function luaFunc() return "lua" end local wrapped = newcclosure(luaFunc) print(isnewcclosure(luaFunc)) -- false print(isnewcclosure(wrapped)) -- true print(isnewcclosure(print)) -- false (native C closure) [Notes](https://docs.voltbz.net/docs/closures/isnewcclosure#notes) ------------------------------------------------------------------- * Useful for distinguishing between native C closures and wrapped functions * Returns false for native C closures like `print` [Related Functions](https://docs.voltbz.net/docs/closures/isnewcclosure#related-functions) ------------------------------------------------------------------------------------------- * [`newcclosure`](https://docs.voltbz.net/docs/closures/newcclosure) - Wrap as C closure * [`iscclosure`](https://docs.voltbz.net/docs/closures/iscclosure) - Check if C closure * [`islclosure`](https://docs.voltbz.net/docs/closures/islclosure) - Check if Luau closure [islclosure\ \ Previous Page](https://docs.voltbz.net/docs/closures/islclosure) [newcclosure\ \ Next Page](https://docs.voltbz.net/docs/closures/newcclosure) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/isnewcclosure#syntax) [Aliases](https://docs.voltbz.net/docs/closures/isnewcclosure#aliases) [Parameters](https://docs.voltbz.net/docs/closures/isnewcclosure#parameters) [Returns](https://docs.voltbz.net/docs/closures/isnewcclosure#returns) [Description](https://docs.voltbz.net/docs/closures/isnewcclosure#description) [Example](https://docs.voltbz.net/docs/closures/isnewcclosure#example) [Notes](https://docs.voltbz.net/docs/closures/isnewcclosure#notes) [Related Functions](https://docs.voltbz.net/docs/closures/isnewcclosure#related-functions) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) newcclosure =========== Wraps a Luau function to appear as a C closure. [Syntax](https://docs.voltbz.net/docs/closures/newcclosure#syntax) ------------------------------------------------------------------- newcclosure(func: function, debugname?: string) -> function [Parameters](https://docs.voltbz.net/docs/closures/newcclosure#parameters) --------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The Luau function to wrap | | `debugname` | `string?` | Optional debug name for the wrapper | [Returns](https://docs.voltbz.net/docs/closures/newcclosure#returns) --------------------------------------------------------------------- | Type | Description | | --- | --- | | `function` | A C closure wrapper that calls the original function | [Description](https://docs.voltbz.net/docs/closures/newcclosure#description) ----------------------------------------------------------------------------- `newcclosure` wraps a Luau function so that it appears to be a C closure when inspected. The wrapped function behaves identically but `iscclosure` will return `true` for it. [Example](https://docs.voltbz.net/docs/closures/newcclosure#example) --------------------------------------------------------------------- local function myHook(...) print("Hooked!") return ... end -- Check before wrapping print(iscclosure(myHook)) -- false -- Wrap it local wrapped = newcclosure(myHook) -- Now it appears as a C closure print(iscclosure(wrapped)) -- true -- But still works the same wrapped("test") -- Output: Hooked! [With a Debug Name](https://docs.voltbz.net/docs/closures/newcclosure#with-a-debug-name) ----------------------------------------------------------------------------------------- local wrapped = newcclosure(function() print("Handling request") end, "RequestHandler") wrapped() [Notes](https://docs.voltbz.net/docs/closures/newcclosure#notes) ----------------------------------------------------------------- * The wrapper is yieldable * It has no upvalues and reports errors with C-closure semantics * `debugname` changes the name shown by debug tooling [Related Functions](https://docs.voltbz.net/docs/closures/newcclosure#related-functions) ----------------------------------------------------------------------------------------- * [`newlclosure`](https://docs.voltbz.net/docs/closures/newlclosure) - Wrap as Luau closure * [`iscclosure`](https://docs.voltbz.net/docs/closures/iscclosure) - Check if C closure * [`isnewcclosure`](https://docs.voltbz.net/docs/closures/isnewcclosure) - Check if newcclosure [isnewcclosure\ \ Previous Page](https://docs.voltbz.net/docs/closures/isnewcclosure) [newlclosure\ \ Next Page](https://docs.voltbz.net/docs/closures/newlclosure) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/newcclosure#syntax) [Parameters](https://docs.voltbz.net/docs/closures/newcclosure#parameters) [Returns](https://docs.voltbz.net/docs/closures/newcclosure#returns) [Description](https://docs.voltbz.net/docs/closures/newcclosure#description) [Example](https://docs.voltbz.net/docs/closures/newcclosure#example) [With a Debug Name](https://docs.voltbz.net/docs/closures/newcclosure#with-a-debug-name) [Notes](https://docs.voltbz.net/docs/closures/newcclosure#notes) [Related Functions](https://docs.voltbz.net/docs/closures/newcclosure#related-functions) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) newlclosure =========== Wraps a C closure to appear as a Luau closure. [Syntax](https://docs.voltbz.net/docs/closures/newlclosure#syntax) ------------------------------------------------------------------- newlclosure(func: function, debugname?: string) -> function [Parameters](https://docs.voltbz.net/docs/closures/newlclosure#parameters) --------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The C closure to wrap | | `debugname` | `string?` | Optional debug name for the wrapper | [Returns](https://docs.voltbz.net/docs/closures/newlclosure#returns) --------------------------------------------------------------------- | Type | Description | | --- | --- | | `function` | A Luau closure wrapper that calls the original function | [Description](https://docs.voltbz.net/docs/closures/newlclosure#description) ----------------------------------------------------------------------------- `newlclosure` wraps a C closure so that it appears to be a Luau closure when inspected. The wrapped function behaves identically but `islclosure` will return `true` for it. [Example](https://docs.voltbz.net/docs/closures/newlclosure#example) --------------------------------------------------------------------- -- print is a C closure print(iscclosure(print)) -- true print(islclosure(print)) -- false -- Wrap it as a Luau closure local wrappedPrint = newlclosure(print) -- Now it appears as a Luau closure print(iscclosure(wrappedPrint)) -- false print(islclosure(wrappedPrint)) -- true -- But still works the same wrappedPrint("Hello!") -- Output: Hello! [Related Functions](https://docs.voltbz.net/docs/closures/newlclosure#related-functions) ----------------------------------------------------------------------------------------- * [`newcclosure`](https://docs.voltbz.net/docs/closures/newcclosure) - Wrap as C closure * [`islclosure`](https://docs.voltbz.net/docs/closures/islclosure) - Check if Luau closure * [`iscclosure`](https://docs.voltbz.net/docs/closures/iscclosure) - Check if C closure [newcclosure\ \ Previous Page](https://docs.voltbz.net/docs/closures/newcclosure) [restorefunction\ \ Next Page](https://docs.voltbz.net/docs/closures/restorefunction) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/newlclosure#syntax) [Parameters](https://docs.voltbz.net/docs/closures/newlclosure#parameters) [Returns](https://docs.voltbz.net/docs/closures/newlclosure#returns) [Description](https://docs.voltbz.net/docs/closures/newlclosure#description) [Example](https://docs.voltbz.net/docs/closures/newlclosure#example) [Related Functions](https://docs.voltbz.net/docs/closures/newlclosure#related-functions) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) setstackhidden ============== Sets whether a function is hidden from stack traces. [Syntax](https://docs.voltbz.net/docs/closures/setstackhidden#syntax) ---------------------------------------------------------------------- setstackhidden(funcOrLevel: function | number, hidden: boolean) -> () [Parameters](https://docs.voltbz.net/docs/closures/setstackhidden#parameters) ------------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `funcOrLevel` | `function` or `number` | Function to modify, or a non-negative stack level | | `hidden` | `boolean` | Whether to hide from stack | [Returns](https://docs.voltbz.net/docs/closures/setstackhidden#returns) ------------------------------------------------------------------------ This function does not return a value. [Description](https://docs.voltbz.net/docs/closures/setstackhidden#description) -------------------------------------------------------------------------------- `setstackhidden` controls whether a function appears in stack traces and debug info. Hidden functions are invisible to stack inspection. [Example](https://docs.voltbz.net/docs/closures/setstackhidden#example) ------------------------------------------------------------------------ local function secretFunc() print("This function is hidden!") end setstackhidden(secretFunc, true) -- Now secretFunc won't appear in debug.traceback() [Use Cases](https://docs.voltbz.net/docs/closures/setstackhidden#use-cases) ---------------------------------------------------------------------------- * Hiding hook implementations * Preventing detection via stack inspection * Clean stack traces [Related Functions](https://docs.voltbz.net/docs/closures/setstackhidden#related-functions) -------------------------------------------------------------------------------------------- * [`debug.getinfo`](https://docs.voltbz.net/docs/debug/getinfo) - Get function info * [`debug.getcallstack`](https://docs.voltbz.net/docs/debug/getcallstack) - Get call stack [restorefunction\ \ Previous Page](https://docs.voltbz.net/docs/closures/restorefunction) [Debug\ \ Next Page](https://docs.voltbz.net/docs/debug) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/setstackhidden#syntax) [Parameters](https://docs.voltbz.net/docs/closures/setstackhidden#parameters) [Returns](https://docs.voltbz.net/docs/closures/setstackhidden#returns) [Description](https://docs.voltbz.net/docs/closures/setstackhidden#description) [Example](https://docs.voltbz.net/docs/closures/setstackhidden#example) [Use Cases](https://docs.voltbz.net/docs/closures/setstackhidden#use-cases) [Related Functions](https://docs.voltbz.net/docs/closures/setstackhidden#related-functions) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) checkcaller =========== Returns whether the current function was called by Volt. [Syntax](https://docs.voltbz.net/docs/closures/checkcaller#syntax) ------------------------------------------------------------------- checkcaller() -> boolean [Returns](https://docs.voltbz.net/docs/closures/checkcaller#returns) --------------------------------------------------------------------- | Type | Description | | --- | --- | | `boolean` | `true` if called from a Volt thread, `false` otherwise | [Description](https://docs.voltbz.net/docs/closures/checkcaller#description) ----------------------------------------------------------------------------- `checkcaller` returns a boolean indicating whether the current function was invoked from Volt's own thread. This is useful for differentiating between your own calls and those made by the game. When you hook a game function, both your code and the game will trigger it. Use `checkcaller` to determine whether to run custom logic or pass through to the original. [Example](https://docs.voltbz.net/docs/closures/checkcaller#example) --------------------------------------------------------------------- local old old = hookfunction(game.HttpGet, function(self, url, ...) if checkcaller() then -- Call is from our script, allow it return old(self, url, ...) end -- Call is from the game, we can block or modify it print("Game tried to fetch:", url) return old(self, url, ...) end) -- This will pass checkcaller() because we're calling it local result = game:HttpGet("https://example.com") [Closures\ \ Previous Page](https://docs.voltbz.net/docs/closures) [clonefunction\ \ Next Page](https://docs.voltbz.net/docs/closures/clonefunction) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/checkcaller#syntax) [Returns](https://docs.voltbz.net/docs/closures/checkcaller#returns) [Description](https://docs.voltbz.net/docs/closures/checkcaller#description) [Example](https://docs.voltbz.net/docs/closures/checkcaller#example) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) clonefunction ============= Creates a copy of the given function. [Syntax](https://docs.voltbz.net/docs/closures/clonefunction#syntax) --------------------------------------------------------------------- clonefunction(func: function) -> function [Parameters](https://docs.voltbz.net/docs/closures/clonefunction#parameters) ----------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The function to clone | [Returns](https://docs.voltbz.net/docs/closures/clonefunction#returns) ----------------------------------------------------------------------- | Type | Description | | --- | --- | | `function` | A copy of the original function | [Description](https://docs.voltbz.net/docs/closures/clonefunction#description) ------------------------------------------------------------------------------- `clonefunction` creates an independent copy of a function. The cloned function behaves identically to the original but is a separate entity. This is particularly useful when you need to keep a reference to the original behavior before hooking. [Example](https://docs.voltbz.net/docs/closures/clonefunction#example) ----------------------------------------------------------------------- -- Clone a function before hooking it local originalPrint = clonefunction(print) -- Now hook the original hookfunction(print, function(...) originalPrint("[HOOKED]", ...) end) -- The clone still works as the original originalPrint("This bypasses the hook") -- The hooked version adds prefix print("This goes through the hook") -- Output: [HOOKED] This goes through the hook [Notes](https://docs.voltbz.net/docs/closures/clonefunction#notes) ------------------------------------------------------------------- * The cloned function shares the same upvalues as the original * C closures are supported * Cloning is useful for preserving original behavior during hooks [checkcaller\ \ Previous Page](https://docs.voltbz.net/docs/closures/checkcaller) [getfunctionhash\ \ Next Page](https://docs.voltbz.net/docs/closures/getfunctionhash) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/clonefunction#syntax) [Parameters](https://docs.voltbz.net/docs/closures/clonefunction#parameters) [Returns](https://docs.voltbz.net/docs/closures/clonefunction#returns) [Description](https://docs.voltbz.net/docs/closures/clonefunction#description) [Example](https://docs.voltbz.net/docs/closures/clonefunction#example) [Notes](https://docs.voltbz.net/docs/closures/clonefunction#notes) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getcallstack ================== Gets visible call frames from the current thread or another thread. [Syntax](https://docs.voltbz.net/docs/debug/getcallstack#syntax) ----------------------------------------------------------------- debug.getcallstack(thread?: thread) -> {{func: function, currentline: number?}} [Parameters](https://docs.voltbz.net/docs/debug/getcallstack#parameters) ------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `thread` | `thread?` | Thread to inspect; defaults to the current thread | [Returns](https://docs.voltbz.net/docs/debug/getcallstack#returns) ------------------------------------------------------------------- | Type | Description | | --- | --- | | `table` | Array of call stack entries | [Description](https://docs.voltbz.net/docs/debug/getcallstack#description) --------------------------------------------------------------------------- `debug.getcallstack` returns non-hidden frames. Each entry contains the function and, for Luau frames, the current source line. OTH hook frames are followed into their linked original thread. [Example](https://docs.voltbz.net/docs/debug/getcallstack#example) ------------------------------------------------------------------- local function innerFunc() local stack = debug.getcallstack() for i, entry in ipairs(stack) do local info = debug.getinfo(entry.func) print(i, info.name or "anonymous", entry.currentline) end end local function outerFunc() innerFunc() end outerFunc() [Entry Fields](https://docs.voltbz.net/docs/debug/getcallstack#entry-fields) ----------------------------------------------------------------------------- | Field | Description | | --- | --- | | `func` | Function running in this frame | | `currentline` | Current source line for a Luau frame; absent for C frames | [Related Functions](https://docs.voltbz.net/docs/debug/getcallstack#related-functions) --------------------------------------------------------------------------------------- * [`debug.getinfo`](https://docs.voltbz.net/docs/debug/getinfo) - Get info for specific level * [`debug.validlevel`](https://docs.voltbz.net/docs/debug/validlevel) - Check if level is valid [Debug\ \ Previous Page](https://docs.voltbz.net/docs/debug) [debug.getconstant\ \ Next Page](https://docs.voltbz.net/docs/debug/getconstant) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getcallstack#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getcallstack#parameters) [Returns](https://docs.voltbz.net/docs/debug/getcallstack#returns) [Description](https://docs.voltbz.net/docs/debug/getcallstack#description) [Example](https://docs.voltbz.net/docs/debug/getcallstack#example) [Entry Fields](https://docs.voltbz.net/docs/debug/getcallstack#entry-fields) [Related Functions](https://docs.voltbz.net/docs/debug/getcallstack#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getconstant ================= Gets a constant from a function at the specified index. [Syntax](https://docs.voltbz.net/docs/debug/getconstant#syntax) ---------------------------------------------------------------- debug.getconstant(func: function | number | ProtoProxy, index: number) -> any [Parameters](https://docs.voltbz.net/docs/debug/getconstant#parameters) ------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `func` | `function`, stack level, or `ProtoProxy` | The prototype to inspect | | `index` | `number` | The constant index (1-based) | [Returns](https://docs.voltbz.net/docs/debug/getconstant#returns) ------------------------------------------------------------------ | Type | Description | | --- | --- | | `any` | The constant value at the specified index | [Description](https://docs.voltbz.net/docs/debug/getconstant#description) -------------------------------------------------------------------------- `debug.getconstant` retrieves a constant value from a function's bytecode. Constants are literal values like strings, numbers, and booleans that are embedded in the compiled function. [Example](https://docs.voltbz.net/docs/debug/getconstant#example) ------------------------------------------------------------------ local function example() local x = "hello" local y = 42 print(x, y) end -- Constant order is compiler-dependent, so discover the index first for index, value in ipairs(debug.getconstants(example)) do print(index, debug.getconstant(example, index), value) end [Using Stack Level](https://docs.voltbz.net/docs/debug/getconstant#using-stack-level) -------------------------------------------------------------------------------------- You can also pass a stack level instead of a function: local function inner() -- Get constant from the calling function (level 2) print(debug.getconstant(2, 1)) end local function outer() local msg = "from outer" inner() end outer() -- Prints a constant from outer [Notes](https://docs.voltbz.net/docs/debug/getconstant#notes) -------------------------------------------------------------- * Index is 1-based * Not all indices may have constants (some may be nil) * Only works with Luau closures [Related Functions](https://docs.voltbz.net/docs/debug/getconstant#related-functions) -------------------------------------------------------------------------------------- * [`debug.getconstants`](https://docs.voltbz.net/docs/debug/getconstants) - Get all constants * [`debug.setconstant`](https://docs.voltbz.net/docs/debug/setconstant) - Modify a constant [debug.getcallstack\ \ Previous Page](https://docs.voltbz.net/docs/debug/getcallstack) [debug.getconstants\ \ Next Page](https://docs.voltbz.net/docs/debug/getconstants) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getconstant#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getconstant#parameters) [Returns](https://docs.voltbz.net/docs/debug/getconstant#returns) [Description](https://docs.voltbz.net/docs/debug/getconstant#description) [Example](https://docs.voltbz.net/docs/debug/getconstant#example) [Using Stack Level](https://docs.voltbz.net/docs/debug/getconstant#using-stack-level) [Notes](https://docs.voltbz.net/docs/debug/getconstant#notes) [Related Functions](https://docs.voltbz.net/docs/debug/getconstant#related-functions) --- # Volt Documentation [Closures](https://docs.voltbz.net/docs/closures) islclosure ========== Checks if a function is a Luau closure. [Syntax](https://docs.voltbz.net/docs/closures/islclosure#syntax) ------------------------------------------------------------------ islclosure(func: function) -> boolean [Parameters](https://docs.voltbz.net/docs/closures/islclosure#parameters) -------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` | The function to check | [Returns](https://docs.voltbz.net/docs/closures/islclosure#returns) -------------------------------------------------------------------- | Type | Description | | --- | --- | | `boolean` | `true` if the function is a Luau closure, `false` otherwise | [Description](https://docs.voltbz.net/docs/closures/islclosure#description) ---------------------------------------------------------------------------- `islclosure` returns whether the given function is written in Luau rather than C/C++. Luau closures include user-defined functions and script functions. [Example](https://docs.voltbz.net/docs/closures/islclosure#example) -------------------------------------------------------------------- -- User-defined functions are Luau closures local function myFunc() return "hello" end print(islclosure(myFunc)) -- true -- Built-in functions are NOT Luau closures print(islclosure(print)) -- false print(islclosure(type)) -- false -- Wrapped functions are NOT Luau closures local wrapped = newcclosure(myFunc) print(islclosure(wrapped)) -- false [Relationship with iscclosure](https://docs.voltbz.net/docs/closures/islclosure#relationship-with-iscclosure) -------------------------------------------------------------------------------------------------------------- `islclosure` is the logical opposite of `iscclosure`: local function test() end print(islclosure(test)) -- true print(iscclosure(test)) -- false print(islclosure(test) == not iscclosure(test)) -- true [Related Functions](https://docs.voltbz.net/docs/closures/islclosure#related-functions) ---------------------------------------------------------------------------------------- * [`iscclosure`](https://docs.voltbz.net/docs/closures/iscclosure) - Check if a function is a C closure * [`newcclosure`](https://docs.voltbz.net/docs/closures/newcclosure) - Convert a Luau closure to a C closure [isfunctionhooked\ \ Previous Page](https://docs.voltbz.net/docs/closures/isfunctionhooked) [isnewcclosure\ \ Next Page](https://docs.voltbz.net/docs/closures/isnewcclosure) ### On this page [Syntax](https://docs.voltbz.net/docs/closures/islclosure#syntax) [Parameters](https://docs.voltbz.net/docs/closures/islclosure#parameters) [Returns](https://docs.voltbz.net/docs/closures/islclosure#returns) [Description](https://docs.voltbz.net/docs/closures/islclosure#description) [Example](https://docs.voltbz.net/docs/closures/islclosure#example) [Relationship with iscclosure](https://docs.voltbz.net/docs/closures/islclosure#relationship-with-iscclosure) [Related Functions](https://docs.voltbz.net/docs/closures/islclosure#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getprotos =============== Gets all protos (nested functions) from a function. [Syntax](https://docs.voltbz.net/docs/debug/getprotos#syntax) -------------------------------------------------------------- debug.getprotos(func: function | number | ProtoProxy) -> {ProtoProxy} [Parameters](https://docs.voltbz.net/docs/debug/getprotos#parameters) ---------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function`, stack level, or `ProtoProxy` | The prototype to inspect | [Returns](https://docs.voltbz.net/docs/debug/getprotos#returns) ---------------------------------------------------------------- | Type | Description | | --- | --- | | `table` | An array of `ProtoProxy` values for all nested prototypes | [Description](https://docs.voltbz.net/docs/debug/getprotos#description) ------------------------------------------------------------------------ `debug.getprotos` returns `ProtoProxy` values for nested functions. These values can be used with compatible debug functions, but cannot be called directly. [Example](https://docs.voltbz.net/docs/debug/getprotos#example) ---------------------------------------------------------------- local function container() local function a() return 1 end local function b() return 2 end local function c() return 3 end return a() + b() + c() end local protos = debug.getprotos(container) print(#protos) -- 3 for i, proto in ipairs(protos) do print(i, typeof(proto), #debug.getconstants(proto)) end [Use Cases](https://docs.voltbz.net/docs/debug/getprotos#use-cases) -------------------------------------------------------------------- * **Script analysis**: Find all functions defined within a script * **Hooking**: Locate specific nested functions to hook * **Debugging**: Inspect the structure of complex functions [Related Functions](https://docs.voltbz.net/docs/debug/getprotos#related-functions) ------------------------------------------------------------------------------------ * [`debug.getproto`](https://docs.voltbz.net/docs/debug/getproto) - Get a single proto by index [debug.getproto\ \ Previous Page](https://docs.voltbz.net/docs/debug/getproto) [debug.getstack\ \ Next Page](https://docs.voltbz.net/docs/debug/getstack) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getprotos#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getprotos#parameters) [Returns](https://docs.voltbz.net/docs/debug/getprotos#returns) [Description](https://docs.voltbz.net/docs/debug/getprotos#description) [Example](https://docs.voltbz.net/docs/debug/getprotos#example) [Use Cases](https://docs.voltbz.net/docs/debug/getprotos#use-cases) [Related Functions](https://docs.voltbz.net/docs/debug/getprotos#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) ProtoProxy ========== Represents a nested Luau prototype without presenting it as an activated closure. [Creation](https://docs.voltbz.net/docs/debug/protoproxy#creation) ------------------------------------------------------------------- `debug.getproto` and `debug.getprotos` return `ProtoProxy` values unless activated closures are explicitly requested. [Properties](https://docs.voltbz.net/docs/debug/protoproxy#properties) ----------------------------------------------------------------------- proxy.CodeHash: number `CodeHash` is a signed 32-bit hash of the prototype's instructions. It is useful for comparing proxies during the same executor version, but it is not a cryptographic digest. [Supported Functions](https://docs.voltbz.net/docs/debug/protoproxy#supported-functions) ----------------------------------------------------------------------------------------- A `ProtoProxy` can be passed to: * `debug.getproto` and `debug.getprotos` * `debug.getconstant` and `debug.getconstants` * `debug.setconstant` * `debug.getinfo` and `debug.setinfo` * Luau's `debug.info` Calling a `ProtoProxy` is accepted by its metatable but returns no values and does not execute the nested function. local function outer() local function inner() return "value" end return inner end local proxy = debug.getproto(outer, 1) print(typeof(proxy)) -- ProtoProxy print(proxy.CodeHash) print(proxy()) -- nil; the nested function is not executed [debug.getupvalues\ \ Previous Page](https://docs.voltbz.net/docs/debug/getupvalues) [debug.setconstant\ \ Next Page](https://docs.voltbz.net/docs/debug/setconstant) ### On this page [Creation](https://docs.voltbz.net/docs/debug/protoproxy#creation) [Properties](https://docs.voltbz.net/docs/debug/protoproxy#properties) [Supported Functions](https://docs.voltbz.net/docs/debug/protoproxy#supported-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.setconstant ================= Sets a constant in a function at the specified index. [Syntax](https://docs.voltbz.net/docs/debug/setconstant#syntax) ---------------------------------------------------------------- debug.setconstant(func: function | number | ProtoProxy, index: number, value: any) -> function [Parameters](https://docs.voltbz.net/docs/debug/setconstant#parameters) ------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `func` | `function`, stack level, or `ProtoProxy` | The prototype to modify | | `index` | `number` | The constant index (1-based) | | `value` | `any` | The new value for the constant | [Returns](https://docs.voltbz.net/docs/debug/setconstant#returns) ------------------------------------------------------------------ | Type | Description | | --- | --- | | `function` | The function whose constant was changed | [Description](https://docs.voltbz.net/docs/debug/setconstant#description) -------------------------------------------------------------------------- `debug.setconstant` modifies a constant value in a function's bytecode. This allows you to change literal values that the function uses. [Example](https://docs.voltbz.net/docs/debug/setconstant#example) ------------------------------------------------------------------ local function greet() return "Hello, World!" end print(greet()) -- "Hello, World!" -- Find and change the string constant local constants = debug.getconstants(greet) for i, v in pairs(constants) do if v == "Hello, World!" then debug.setconstant(greet, i, "Goodbye, World!") break end end print(greet()) -- "Goodbye, World!" [Caution](https://docs.voltbz.net/docs/debug/setconstant#caution) ------------------------------------------------------------------ Modifying constants can cause unexpected behavior if: * The constant is used in multiple places * You set an incompatible type * The bytecode expects a specific value [Use Cases](https://docs.voltbz.net/docs/debug/setconstant#use-cases) ---------------------------------------------------------------------- * **Patching**: Change hardcoded values in game scripts * **Testing**: Modify behavior without changing source * **Bypasses**: Alter check values [Related Functions](https://docs.voltbz.net/docs/debug/setconstant#related-functions) -------------------------------------------------------------------------------------- * [`debug.getconstant`](https://docs.voltbz.net/docs/debug/getconstant) - Get a constant * [`debug.getconstants`](https://docs.voltbz.net/docs/debug/getconstants) - Get all constants [ProtoProxy\ \ Previous Page](https://docs.voltbz.net/docs/debug/protoproxy) [debug.setinfo\ \ Next Page](https://docs.voltbz.net/docs/debug/setinfo) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/setconstant#syntax) [Parameters](https://docs.voltbz.net/docs/debug/setconstant#parameters) [Returns](https://docs.voltbz.net/docs/debug/setconstant#returns) [Description](https://docs.voltbz.net/docs/debug/setconstant#description) [Example](https://docs.voltbz.net/docs/debug/setconstant#example) [Caution](https://docs.voltbz.net/docs/debug/setconstant#caution) [Use Cases](https://docs.voltbz.net/docs/debug/setconstant#use-cases) [Related Functions](https://docs.voltbz.net/docs/debug/setconstant#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.setinfo ============= Changes selected debug metadata on a Luau function or proto. [Syntax](https://docs.voltbz.net/docs/debug/setinfo#syntax) ------------------------------------------------------------ debug.setinfo(func_or_level: function | number | ProtoProxy, info: table) -> () [Parameters](https://docs.voltbz.net/docs/debug/setinfo#parameters) -------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func_or_level` | `function`, stack level, or `ProtoProxy` | Luau proto to modify | | `info` | `table` | Metadata fields to assign | [Supported Fields](https://docs.voltbz.net/docs/debug/setinfo#supported-fields) -------------------------------------------------------------------------------- | Field | Type | Description | | --- | --- | --- | | `source` | `string` | Full source identifier | | `short_src` | `string` | Replacement source identifier that preserves a leading `=` or `@` marker | | `name` | `string` | Function debug name | | `currentline` | `number` | Function definition line | If both `source` and `short_src` are present, `source` takes precedence. [Example](https://docs.voltbz.net/docs/debug/setinfo#example) -------------------------------------------------------------- local function example() return true end debug.setinfo(example, { source = "@custom/example.luau", name = "renamed_example", currentline = 25, }) local info = debug.getinfo(example) print(info.source) -- @custom/example.luau print(info.name) -- renamed_example print(info.currentline) -- 25 [Notes](https://docs.voltbz.net/docs/debug/setinfo#notes) ---------------------------------------------------------- * C closures are rejected [Related Functions](https://docs.voltbz.net/docs/debug/setinfo#related-functions) ---------------------------------------------------------------------------------- * [`debug.getinfo`](https://docs.voltbz.net/docs/debug/getinfo) - Read debug metadata * [`debug.getproto`](https://docs.voltbz.net/docs/debug/getproto) - Access nested protos [debug.setconstant\ \ Previous Page](https://docs.voltbz.net/docs/debug/setconstant) [debug.setstack\ \ Next Page](https://docs.voltbz.net/docs/debug/setstack) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/setinfo#syntax) [Parameters](https://docs.voltbz.net/docs/debug/setinfo#parameters) [Supported Fields](https://docs.voltbz.net/docs/debug/setinfo#supported-fields) [Example](https://docs.voltbz.net/docs/debug/setinfo#example) [Notes](https://docs.voltbz.net/docs/debug/setinfo#notes) [Related Functions](https://docs.voltbz.net/docs/debug/setinfo#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getupvalues ================= Gets all upvalues from a function. [Syntax](https://docs.voltbz.net/docs/debug/getupvalues#syntax) ---------------------------------------------------------------- debug.getupvalues(func: function | number) -> table [Parameters](https://docs.voltbz.net/docs/debug/getupvalues#parameters) ------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` or `number` | The function or stack level | [Returns](https://docs.voltbz.net/docs/debug/getupvalues#returns) ------------------------------------------------------------------ | Type | Description | | --- | --- | | `table` | A table mapping indices to upvalue values | [Description](https://docs.voltbz.net/docs/debug/getupvalues#description) -------------------------------------------------------------------------- `debug.getupvalues` returns a table containing all upvalues (captured variables) of a function. [Example](https://docs.voltbz.net/docs/debug/getupvalues#example) ------------------------------------------------------------------ local a = 1 local b = "hello" local c = {key = "value"} local function example() print(a, b, c.key) end local upvalues = debug.getupvalues(example) for i, v in pairs(upvalues) do print(i, type(v), v) end --[[\ Output:\ 1 number 1\ 2 string hello\ 3 table table: 0x...\ ]] [Practical Use](https://docs.voltbz.net/docs/debug/getupvalues#practical-use) ------------------------------------------------------------------------------ -- Find all string upvalues in a function local function getStringUpvalues(func) local strings = {} for i, upvalue in pairs(debug.getupvalues(func)) do if type(upvalue) == "string" then strings[i] = upvalue end end return strings end [Related Functions](https://docs.voltbz.net/docs/debug/getupvalues#related-functions) -------------------------------------------------------------------------------------- * [`debug.getupvalue`](https://docs.voltbz.net/docs/debug/getupvalue) - Get a single upvalue * [`debug.setupvalue`](https://docs.voltbz.net/docs/debug/setupvalue) - Modify an upvalue [debug.getupvalue\ \ Previous Page](https://docs.voltbz.net/docs/debug/getupvalue) [ProtoProxy\ \ Next Page](https://docs.voltbz.net/docs/debug/protoproxy) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getupvalues#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getupvalues#parameters) [Returns](https://docs.voltbz.net/docs/debug/getupvalues#returns) [Description](https://docs.voltbz.net/docs/debug/getupvalues#description) [Example](https://docs.voltbz.net/docs/debug/getupvalues#example) [Practical Use](https://docs.voltbz.net/docs/debug/getupvalues#practical-use) [Related Functions](https://docs.voltbz.net/docs/debug/getupvalues#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.setupvalue ================ Sets an upvalue in a function by index. [Syntax](https://docs.voltbz.net/docs/debug/setupvalue#syntax) --------------------------------------------------------------- debug.setupvalue(func: function | number, index: number, value: any) -> () [Parameters](https://docs.voltbz.net/docs/debug/setupvalue#parameters) ----------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` or `number` | The function or stack level | | `index` | `number` | The upvalue index (1-based) | | `value` | `any` | The new value for the upvalue | [Returns](https://docs.voltbz.net/docs/debug/setupvalue#returns) ----------------------------------------------------------------- This function does not return a value. [Description](https://docs.voltbz.net/docs/debug/setupvalue#description) ------------------------------------------------------------------------- `debug.setupvalue` modifies an upvalue (captured variable) in a function. Changes affect the shared variable, so all functions that capture the same upvalue will see the change. [Example](https://docs.voltbz.net/docs/debug/setupvalue#example) ----------------------------------------------------------------- local count = 0 local function getCount() return count end local function increment() count = count + 1 end print(getCount()) -- 0 -- Directly modify the upvalue debug.setupvalue(getCount, 1, 100) print(getCount()) -- 100 increment() print(getCount()) -- 101 [Shared Upvalues](https://docs.voltbz.net/docs/debug/setupvalue#shared-upvalues) --------------------------------------------------------------------------------- When multiple functions share an upvalue, modifying it affects all of them: local shared = "original" local function read() return shared end local function write(val) shared = val end -- Both functions share the same upvalue debug.setupvalue(read, 1, "modified") print(read()) -- "modified" print(write) -- The write function also sees the change [Related Functions](https://docs.voltbz.net/docs/debug/setupvalue#related-functions) ------------------------------------------------------------------------------------- * [`debug.getupvalue`](https://docs.voltbz.net/docs/debug/getupvalue) - Get an upvalue * [`debug.getupvalues`](https://docs.voltbz.net/docs/debug/getupvalues) - Get all upvalues [debug.setstack\ \ Previous Page](https://docs.voltbz.net/docs/debug/setstack) [debug.validlevel\ \ Next Page](https://docs.voltbz.net/docs/debug/validlevel) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/setupvalue#syntax) [Parameters](https://docs.voltbz.net/docs/debug/setupvalue#parameters) [Returns](https://docs.voltbz.net/docs/debug/setupvalue#returns) [Description](https://docs.voltbz.net/docs/debug/setupvalue#description) [Example](https://docs.voltbz.net/docs/debug/setupvalue#example) [Shared Upvalues](https://docs.voltbz.net/docs/debug/setupvalue#shared-upvalues) [Related Functions](https://docs.voltbz.net/docs/debug/setupvalue#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.setstack ============== Sets a value on the stack at a specific level and index. [Syntax](https://docs.voltbz.net/docs/debug/setstack#syntax) ------------------------------------------------------------- debug.setstack(level: number, index: number, value: any) -> () debug.setstack(thread: thread, level: number, index: number, value: any) -> () [Parameters](https://docs.voltbz.net/docs/debug/setstack#parameters) --------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `level` | `number` | The stack level (1 = current function) | | `index` | `number` | The stack slot index | | `value` | `any` | The new value to set | | `thread` | `thread?` | Optional thread to modify before `level` | [Returns](https://docs.voltbz.net/docs/debug/setstack#returns) --------------------------------------------------------------- This function does not return a value. [Description](https://docs.voltbz.net/docs/debug/setstack#description) ----------------------------------------------------------------------- `debug.setstack` modifies a value on the call stack. This can change local variables in any active function on the stack. [Example](https://docs.voltbz.net/docs/debug/setstack#example) --------------------------------------------------------------- local function modifier() for index, stackValue in ipairs(debug.getstack(2)) do if stackValue == "original" then debug.setstack(2, index, "modified!") return end end end local function example() local value = "original" modifier() print(value) -- "modified!" end example() [Caution](https://docs.voltbz.net/docs/debug/setstack#caution) --------------------------------------------------------------- Modifying stack values can cause crashes or undefined behavior if: * You set an incompatible type * The index doesn't exist * The value is used in unexpected ways [Related Functions](https://docs.voltbz.net/docs/debug/setstack#related-functions) ----------------------------------------------------------------------------------- * [`debug.getstack`](https://docs.voltbz.net/docs/debug/getstack) - Get a stack value [debug.setinfo\ \ Previous Page](https://docs.voltbz.net/docs/debug/setinfo) [debug.setupvalue\ \ Next Page](https://docs.voltbz.net/docs/debug/setupvalue) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/setstack#syntax) [Parameters](https://docs.voltbz.net/docs/debug/setstack#parameters) [Returns](https://docs.voltbz.net/docs/debug/setstack#returns) [Description](https://docs.voltbz.net/docs/debug/setstack#description) [Example](https://docs.voltbz.net/docs/debug/setstack#example) [Caution](https://docs.voltbz.net/docs/debug/setstack#caution) [Related Functions](https://docs.voltbz.net/docs/debug/setstack#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.validlevel ================ Checks if a stack level is valid. [Syntax](https://docs.voltbz.net/docs/debug/validlevel#syntax) --------------------------------------------------------------- debug.validlevel(level: number, thread?: thread) -> boolean [Aliases](https://docs.voltbz.net/docs/debug/validlevel#aliases) ----------------------------------------------------------------- * `debug.isvalidlevel` [Parameters](https://docs.voltbz.net/docs/debug/validlevel#parameters) ----------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `level` | `number` | The stack level | | `thread` | `thread?` | Thread to inspect; defaults to the current thread | [Returns](https://docs.voltbz.net/docs/debug/validlevel#returns) ----------------------------------------------------------------- | Type | Description | | --- | --- | | `boolean` | True if the stack level is valid | [Description](https://docs.voltbz.net/docs/debug/validlevel#description) ------------------------------------------------------------------------- `debug.validlevel` checks whether a given stack level exists and is valid for debugging operations. [Example](https://docs.voltbz.net/docs/debug/validlevel#example) ----------------------------------------------------------------- -- Check stack levels for i = 0, 10 do if debug.validlevel(i) then print("Level " .. i .. " is valid") else print("Level " .. i .. " is invalid") break end end [Related Functions](https://docs.voltbz.net/docs/debug/validlevel#related-functions) ------------------------------------------------------------------------------------- * [`debug.getinfo`](https://docs.voltbz.net/docs/debug/getinfo) - Get function info * [`debug.getcallstack`](https://docs.voltbz.net/docs/debug/getcallstack) - Get call stack [debug.setupvalue\ \ Previous Page](https://docs.voltbz.net/docs/debug/setupvalue) [Reflection\ \ Next Page](https://docs.voltbz.net/docs/reflection) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/validlevel#syntax) [Aliases](https://docs.voltbz.net/docs/debug/validlevel#aliases) [Parameters](https://docs.voltbz.net/docs/debug/validlevel#parameters) [Returns](https://docs.voltbz.net/docs/debug/validlevel#returns) [Description](https://docs.voltbz.net/docs/debug/validlevel#description) [Example](https://docs.voltbz.net/docs/debug/validlevel#example) [Related Functions](https://docs.voltbz.net/docs/debug/validlevel#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getconstants ================== Gets all constants from a function. [Syntax](https://docs.voltbz.net/docs/debug/getconstants#syntax) ----------------------------------------------------------------- debug.getconstants(func: function | number | ProtoProxy) -> table [Parameters](https://docs.voltbz.net/docs/debug/getconstants#parameters) ------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function`, stack level, or `ProtoProxy` | The prototype to inspect | [Returns](https://docs.voltbz.net/docs/debug/getconstants#returns) ------------------------------------------------------------------- | Type | Description | | --- | --- | | `table` | An array of all constants in the function | [Description](https://docs.voltbz.net/docs/debug/getconstants#description) --------------------------------------------------------------------------- `debug.getconstants` returns a table containing all constant values embedded in a function's bytecode. This is useful for inspecting what literal values a function uses. [Example](https://docs.voltbz.net/docs/debug/getconstants#example) ------------------------------------------------------------------- local function greet(name) local greeting = "Hello" local punctuation = "!" return greeting .. ", " .. name .. punctuation end local constants = debug.getconstants(greet) for i, v in ipairs(constants) do print(i, type(v), v) end --[[\ Output:\ 1 string Hello\ 2 string !\ 3 string , \ ]] [Inspecting Game Functions](https://docs.voltbz.net/docs/debug/getconstants#inspecting-game-functions) ------------------------------------------------------------------------------------------------------- -- Find what strings a function uses local function findStrings(func) local strings = {} for i, const in ipairs(debug.getconstants(func)) do if type(const) == "string" then table.insert(strings, const) end end return strings end [Notes](https://docs.voltbz.net/docs/debug/getconstants#notes) --------------------------------------------------------------- * The table is indexed starting at 1 * Some indices may contain `nil` for unused constant slots * Only works with Luau closures [Related Functions](https://docs.voltbz.net/docs/debug/getconstants#related-functions) --------------------------------------------------------------------------------------- * [`debug.getconstant`](https://docs.voltbz.net/docs/debug/getconstant) - Get a single constant * [`debug.setconstant`](https://docs.voltbz.net/docs/debug/setconstant) - Modify a constant [debug.getconstant\ \ Previous Page](https://docs.voltbz.net/docs/debug/getconstant) [debug.getinfo\ \ Next Page](https://docs.voltbz.net/docs/debug/getinfo) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getconstants#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getconstants#parameters) [Returns](https://docs.voltbz.net/docs/debug/getconstants#returns) [Description](https://docs.voltbz.net/docs/debug/getconstants#description) [Example](https://docs.voltbz.net/docs/debug/getconstants#example) [Inspecting Game Functions](https://docs.voltbz.net/docs/debug/getconstants#inspecting-game-functions) [Notes](https://docs.voltbz.net/docs/debug/getconstants#notes) [Related Functions](https://docs.voltbz.net/docs/debug/getconstants#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getinfo ============= Gets information about a function or stack level. [Syntax](https://docs.voltbz.net/docs/debug/getinfo#syntax) ------------------------------------------------------------ debug.getinfo(func_or_level: function | number | ProtoProxy) -> table [Parameters](https://docs.voltbz.net/docs/debug/getinfo#parameters) -------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func_or_level` | `function`, `number`, or `ProtoProxy` | Function, stack level, or nested prototype | [Returns](https://docs.voltbz.net/docs/debug/getinfo#returns) -------------------------------------------------------------- | Type | Description | | --- | --- | | `table` | Information about target | [Description](https://docs.voltbz.net/docs/debug/getinfo#description) ---------------------------------------------------------------------- `debug.getinfo` returns a table with information about a function or the function at a given stack level. [Info Fields](https://docs.voltbz.net/docs/debug/getinfo#info-fields) ---------------------------------------------------------------------- | Field | Description | | --- | --- | | `name` | Function name, or an empty string | | `source` | Source identifier | | `short_src` | Short source name | | `what` | `Lua`, `C`, or `main` | | `currentline` | Current line, or the runtime sentinel for a non-active function | | `nups` | Number of upvalues | | `numparams` | Number of parameters | | `is_vararg` | `1` for a variadic function, otherwise `0` | | `func` | Function or `ProtoProxy` passed in | [Example](https://docs.voltbz.net/docs/debug/getinfo#example) -------------------------------------------------------------- local function myFunc() return "hello" end local info = debug.getinfo(myFunc) print("Name:", info.name) print("Source:", info.short_src) print("Current line:", info.currentline) -- Get info for current function local currentInfo = debug.getinfo(1) print("Current function:", currentInfo.name) [Related Functions](https://docs.voltbz.net/docs/debug/getinfo#related-functions) ---------------------------------------------------------------------------------- * [`debug.getcallstack`](https://docs.voltbz.net/docs/debug/getcallstack) - Get full call stack * [`debug.validlevel`](https://docs.voltbz.net/docs/debug/validlevel) - Check if level is valid [debug.getconstants\ \ Previous Page](https://docs.voltbz.net/docs/debug/getconstants) [debug.getproto\ \ Next Page](https://docs.voltbz.net/docs/debug/getproto) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getinfo#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getinfo#parameters) [Returns](https://docs.voltbz.net/docs/debug/getinfo#returns) [Description](https://docs.voltbz.net/docs/debug/getinfo#description) [Info Fields](https://docs.voltbz.net/docs/debug/getinfo#info-fields) [Example](https://docs.voltbz.net/docs/debug/getinfo#example) [Related Functions](https://docs.voltbz.net/docs/debug/getinfo#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getproto ============== Gets a proto (nested function) from a function. [Syntax](https://docs.voltbz.net/docs/debug/getproto#syntax) ------------------------------------------------------------- debug.getproto(func: function | number | ProtoProxy, index: number, activated?: boolean) -> ProtoProxy | {function} [Parameters](https://docs.voltbz.net/docs/debug/getproto#parameters) --------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` or `number` | The function or stack level | | `index` | `number` | The proto index (1-based) | | `activated` | `boolean?` | If true, returns all activated instances | [Returns](https://docs.voltbz.net/docs/debug/getproto#returns) --------------------------------------------------------------- | Type | Description | | --- | --- | | `ProtoProxy` | The nested prototype when `activated` is false or omitted | | `table` | Array of activated instances (if `activated` is true) | [Description](https://docs.voltbz.net/docs/debug/getproto#description) ----------------------------------------------------------------------- `debug.getproto` retrieves a nested prototype. By default Volt returns a non-executable `ProtoProxy` that can be inspected by other debug APIs. With `activated = true`, it returns the live closures currently using that prototype. [Example](https://docs.voltbz.net/docs/debug/getproto#example) --------------------------------------------------------------- local function outer() local function inner1() print("inner1") end local function inner2() print("inner2") end inner1() inner2() end -- Get and inspect the first nested prototype local proto1 = debug.getproto(outer, 1) print(debug.getconstants(proto1)) -- Get the second nested function local proto2 = debug.getproto(outer, 2) print(debug.getconstants(proto2)) [Activated Instances](https://docs.voltbz.net/docs/debug/getproto#activated-instances) --------------------------------------------------------------------------------------- When `activated` is true, returns all instances of the proto that have been created: local retainedClosures = {} local function factory() local function create() return {} end table.insert(retainedClosures, create) end factory() -- Get all activated instances of the inner function local activated = debug.getproto(factory, 1, true) print(#activated) -- 1 while the retained closure is alive [Related Functions](https://docs.voltbz.net/docs/debug/getproto#related-functions) ----------------------------------------------------------------------------------- * [`debug.getprotos`](https://docs.voltbz.net/docs/debug/getprotos) - Get all protos from a function [debug.getinfo\ \ Previous Page](https://docs.voltbz.net/docs/debug/getinfo) [debug.getprotos\ \ Next Page](https://docs.voltbz.net/docs/debug/getprotos) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getproto#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getproto#parameters) [Returns](https://docs.voltbz.net/docs/debug/getproto#returns) [Description](https://docs.voltbz.net/docs/debug/getproto#description) [Example](https://docs.voltbz.net/docs/debug/getproto#example) [Activated Instances](https://docs.voltbz.net/docs/debug/getproto#activated-instances) [Related Functions](https://docs.voltbz.net/docs/debug/getproto#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getstack ============== Gets one value or all values from a Luau stack frame. [Syntax](https://docs.voltbz.net/docs/debug/getstack#syntax) ------------------------------------------------------------- debug.getstack(level: number, index?: number) -> any | {any} debug.getstack(thread: thread, level: number, index?: number) -> any | {any} [Parameters](https://docs.voltbz.net/docs/debug/getstack#parameters) --------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `level` | `number` | The stack level (1 = current function) | | `index` | `number?` | The stack slot index. Omit it to return every value at the level | | `thread` | `thread?` | Optional thread to inspect before `level` | [Returns](https://docs.voltbz.net/docs/debug/getstack#returns) --------------------------------------------------------------- | Type | Description | | --- | --- | | `any` or `{any}` | The selected value, or an array of every value when `index` is omitted | [Description](https://docs.voltbz.net/docs/debug/getstack#description) ----------------------------------------------------------------------- `debug.getstack` retrieves values from a Luau call frame. It throws if `level` refers to a C closure, including level `0`. [Example](https://docs.voltbz.net/docs/debug/getstack#example) --------------------------------------------------------------- local marker = "caller value" local function inspectCaller() local callerStack = debug.getstack(2) for index, value in ipairs(callerStack) do print(index, value) assert(debug.getstack(2, index) == value) end end inspectCaller() [Stack Levels](https://docs.voltbz.net/docs/debug/getstack#stack-levels) ------------------------------------------------------------------------- | Level | Meaning | | --- | --- | | 1 | Current function | | 2 | Calling function | | 3 | Caller of the caller | | ... | And so on | [Notes](https://docs.voltbz.net/docs/debug/getstack#notes) ----------------------------------------------------------- * Stack indices correspond to local variable slots * The exact index depends on the function's compiled bytecode * Values can include locals, parameters, functions, and temporary stack slots * Stack layout is compiler-dependent; do not assume an index without inspecting the frame [Related Functions](https://docs.voltbz.net/docs/debug/getstack#related-functions) ----------------------------------------------------------------------------------- * [`debug.setstack`](https://docs.voltbz.net/docs/debug/setstack) - Modify a stack value [debug.getprotos\ \ Previous Page](https://docs.voltbz.net/docs/debug/getprotos) [debug.getupvalue\ \ Next Page](https://docs.voltbz.net/docs/debug/getupvalue) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getstack#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getstack#parameters) [Returns](https://docs.voltbz.net/docs/debug/getstack#returns) [Description](https://docs.voltbz.net/docs/debug/getstack#description) [Example](https://docs.voltbz.net/docs/debug/getstack#example) [Stack Levels](https://docs.voltbz.net/docs/debug/getstack#stack-levels) [Notes](https://docs.voltbz.net/docs/debug/getstack#notes) [Related Functions](https://docs.voltbz.net/docs/debug/getstack#related-functions) --- # Volt Documentation [Debug](https://docs.voltbz.net/docs/debug) debug.getupvalue ================ Gets an upvalue from a function by index. [Syntax](https://docs.voltbz.net/docs/debug/getupvalue#syntax) --------------------------------------------------------------- debug.getupvalue(func: function | number, index: number) -> any [Parameters](https://docs.voltbz.net/docs/debug/getupvalue#parameters) ----------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `func` | `function` or `number` | The function or stack level | | `index` | `number` | The upvalue index (1-based) | [Returns](https://docs.voltbz.net/docs/debug/getupvalue#returns) ----------------------------------------------------------------- | Type | Description | | --- | --- | | `any` | The upvalue at the specified index | [Description](https://docs.voltbz.net/docs/debug/getupvalue#description) ------------------------------------------------------------------------- `debug.getupvalue` retrieves an upvalue (captured variable from an outer scope) from a function. Upvalues are variables that a closure "closes over" from its enclosing environment. [Example](https://docs.voltbz.net/docs/debug/getupvalue#example) ----------------------------------------------------------------- local counter = 0 local prefix = "Count: " local function increment() counter = counter + 1 return prefix .. counter end -- Upvalue order is compiler-dependent for index in ipairs(debug.getupvalues(increment)) do print(index, debug.getupvalue(increment, index)) end -- After calling the function increment() [Use Cases](https://docs.voltbz.net/docs/debug/getupvalue#use-cases) --------------------------------------------------------------------- * **Inspect closures**: See what variables a function has captured * **Debugging**: Examine the state of captured variables * **Modification**: Read before modifying with `setupvalue` [Related Functions](https://docs.voltbz.net/docs/debug/getupvalue#related-functions) ------------------------------------------------------------------------------------- * [`debug.getupvalues`](https://docs.voltbz.net/docs/debug/getupvalues) - Get all upvalues * [`debug.setupvalue`](https://docs.voltbz.net/docs/debug/setupvalue) - Modify an upvalue [debug.getstack\ \ Previous Page](https://docs.voltbz.net/docs/debug/getstack) [debug.getupvalues\ \ Next Page](https://docs.voltbz.net/docs/debug/getupvalues) ### On this page [Syntax](https://docs.voltbz.net/docs/debug/getupvalue#syntax) [Parameters](https://docs.voltbz.net/docs/debug/getupvalue#parameters) [Returns](https://docs.voltbz.net/docs/debug/getupvalue#returns) [Description](https://docs.voltbz.net/docs/debug/getupvalue#description) [Example](https://docs.voltbz.net/docs/debug/getupvalue#example) [Use Cases](https://docs.voltbz.net/docs/debug/getupvalue#use-cases) [Related Functions](https://docs.voltbz.net/docs/debug/getupvalue#related-functions) --- # Volt Documentation [Environment](https://docs.voltbz.net/docs/environment) getgc ===== Returns Luau functions tracked by the garbage collector, optionally including tables, userdata, and threads. [Syntax](https://docs.voltbz.net/docs/environment/getgc#syntax) ---------------------------------------------------------------- getgc(includeTables?: boolean) -> table [Parameters](https://docs.voltbz.net/docs/environment/getgc#parameters) ------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `includeTables` | `boolean?` | Whether to include tables (default: false) | [Returns](https://docs.voltbz.net/docs/environment/getgc#returns) ------------------------------------------------------------------ | Type | Description | | --- | --- | | `table` | Array of functions, plus tables, userdata, and threads when requested | [Description](https://docs.voltbz.net/docs/environment/getgc#description) -------------------------------------------------------------------------- By default, `getgc` returns tracked functions. Pass `true` to also include tables, userdata, and threads. [Example](https://docs.voltbz.net/docs/environment/getgc#example) ------------------------------------------------------------------ -- Get all functions in memory for _, obj in ipairs(getgc()) do if type(obj) == "function" then print("Found function:", obj) end end [Finding Specific Functions](https://docs.voltbz.net/docs/environment/getgc#finding-specific-functions) -------------------------------------------------------------------------------------------------------- -- Find a function by its constants local function findFunction(targetString) for _, obj in ipairs(getgc()) do if type(obj) == "function" and islclosure(obj) then local constants = debug.getconstants(obj) for _, const in ipairs(constants) do if const == targetString then return obj end end end end return nil end local targetFunc = findFunction("SomeUniqueString") print(targetFunc or "No matching function was found") [Including Tables](https://docs.voltbz.net/docs/environment/getgc#including-tables) ------------------------------------------------------------------------------------ -- Get all tables (slower, more results) local allObjects = getgc(true) for _, obj in ipairs(allObjects) do if type(obj) == "table" and rawget(obj, "SpecialKey") ~= nil then print("Found target table!") end end [Notes](https://docs.voltbz.net/docs/environment/getgc#notes) -------------------------------------------------------------- * Without `includeTables`, only functions are returned * With `includeTables`, tables, userdata, and threads are added to the result * Including tables can be slow due to the large number of tables in memory * Consider using `filtergc` for more targeted searches [Related Functions](https://docs.voltbz.net/docs/environment/getgc#related-functions) -------------------------------------------------------------------------------------- * [`filtergc`](https://docs.voltbz.net/docs/environment/filtergc) - Filter objects with conditions [getallthreads\ \ Previous Page](https://docs.voltbz.net/docs/environment/getallthreads) [getgenv\ \ Next Page](https://docs.voltbz.net/docs/environment/getgenv) ### On this page [Syntax](https://docs.voltbz.net/docs/environment/getgc#syntax) [Parameters](https://docs.voltbz.net/docs/environment/getgc#parameters) [Returns](https://docs.voltbz.net/docs/environment/getgc#returns) [Description](https://docs.voltbz.net/docs/environment/getgc#description) [Example](https://docs.voltbz.net/docs/environment/getgc#example) [Finding Specific Functions](https://docs.voltbz.net/docs/environment/getgc#finding-specific-functions) [Including Tables](https://docs.voltbz.net/docs/environment/getgc#including-tables) [Notes](https://docs.voltbz.net/docs/environment/getgc#notes) [Related Functions](https://docs.voltbz.net/docs/environment/getgc#related-functions) --- # Volt Documentation [Environment](https://docs.voltbz.net/docs/environment) getallthreads ============= Returns all Luau threads currently reachable by the calling state's garbage collector. [Syntax](https://docs.voltbz.net/docs/environment/getallthreads#syntax) ------------------------------------------------------------------------ getallthreads() -> {thread} [Returns](https://docs.voltbz.net/docs/environment/getallthreads#returns) -------------------------------------------------------------------------- | Type | Description | | --- | --- | | `{thread}` | A weak array containing the threads found during the GC walk | [Example](https://docs.voltbz.net/docs/environment/getallthreads#example) -------------------------------------------------------------------------- local threads = getallthreads() print("Threads found:", #threads) for index, thread in ipairs(threads) do print(index, coroutine.status(thread), getscriptfromthread(thread)) end [Notes](https://docs.voltbz.net/docs/environment/getallthreads#notes) ---------------------------------------------------------------------- * The result is scoped to the caller's Luau state * The result table has weak values, so a thread can disappear after collection if nothing else retains it [Related Functions](https://docs.voltbz.net/docs/environment/getallthreads#related-functions) ---------------------------------------------------------------------------------------------- * [`getgc`](https://docs.voltbz.net/docs/environment/getgc) - Walk other garbage-collected values * [`getscriptfromthread`](https://docs.voltbz.net/docs/scripts/getscriptfromthread) - Get the script associated with a thread [filtergc\ \ Previous Page](https://docs.voltbz.net/docs/environment/filtergc) [getgc\ \ Next Page](https://docs.voltbz.net/docs/environment/getgc) ### On this page [Syntax](https://docs.voltbz.net/docs/environment/getallthreads#syntax) [Returns](https://docs.voltbz.net/docs/environment/getallthreads#returns) [Example](https://docs.voltbz.net/docs/environment/getallthreads#example) [Notes](https://docs.voltbz.net/docs/environment/getallthreads#notes) [Related Functions](https://docs.voltbz.net/docs/environment/getallthreads#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) get\_process\_identifier ======================== Returns the operating-system process identifier for the current game process. [Syntax](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#syntax) ----------------------------------------------------------------------------------- get_process_identifier() -> number [Returns](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#returns) ------------------------------------------------------------------------------------- | Type | Description | | --- | --- | | `number` | Current process ID | [Example](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#example) ------------------------------------------------------------------------------------- local processId = get_process_identifier() print("Game process ID:", processId) print(processId > 0) -- true [Notes](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#notes) --------------------------------------------------------------------------------- * The identifier is assigned by the operating system * It can differ the next time the game starts [clearqueueonteleport\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport) [getfflag\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/getfflag) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#syntax) [Returns](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#returns) [Example](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#example) [Notes](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier#notes) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) getfflag ======== Gets a Fast Flag value. [Syntax](https://docs.voltbz.net/docs/miscellaneous/getfflag#syntax) --------------------------------------------------------------------- getfflag(name: string) -> string [Parameters](https://docs.voltbz.net/docs/miscellaneous/getfflag#parameters) ----------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `name` | `string` | The flag name | [Returns](https://docs.voltbz.net/docs/miscellaneous/getfflag#returns) ----------------------------------------------------------------------- | Type | Description | | --- | --- | | `string` | The flag value | [Description](https://docs.voltbz.net/docs/miscellaneous/getfflag#description) ------------------------------------------------------------------------------- `getfflag` retrieves the current value of a Fast Flag. [Example](https://docs.voltbz.net/docs/miscellaneous/getfflag#example) ----------------------------------------------------------------------- -- Get current target FPS local fps = getfflag("DFIntTaskSchedulerTargetFps") print("Target FPS:", fps) -- Check if a feature is enabled local enabled = getfflag("FFlagSomeFeature") print("Feature enabled:", enabled == "true") [Related Functions](https://docs.voltbz.net/docs/miscellaneous/getfflag#related-functions) ------------------------------------------------------------------------------------------- * [`setfflag`](https://docs.voltbz.net/docs/miscellaneous/setfflag) - Set flag value [get\_process\_identifier\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier) [getfpscap\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/getfpscap) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/getfflag#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/getfflag#parameters) [Returns](https://docs.voltbz.net/docs/miscellaneous/getfflag#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/getfflag#description) [Example](https://docs.voltbz.net/docs/miscellaneous/getfflag#example) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/getfflag#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) gethwid ======= Gets Volt's external user identifier. [Syntax](https://docs.voltbz.net/docs/miscellaneous/gethwid#syntax) -------------------------------------------------------------------- gethwid() -> string [Returns](https://docs.voltbz.net/docs/miscellaneous/gethwid#returns) ---------------------------------------------------------------------- | Type | Description | | --- | --- | | `string` | The current user's opaque external identifier | [Description](https://docs.voltbz.net/docs/miscellaneous/gethwid#description) ------------------------------------------------------------------------------ Despite its compatibility name, `gethwid` returns the external identifier stored by Volt's environment. Scripts should treat it as an opaque string and should not infer which hardware or account properties were used to produce it. [Example](https://docs.voltbz.net/docs/miscellaneous/gethwid#example) ---------------------------------------------------------------------- local identifier = gethwid() print("Volt identifier:", identifier) [Notes](https://docs.voltbz.net/docs/miscellaneous/gethwid#notes) ------------------------------------------------------------------ * Do not parse the identifier or assume a particular format * Avoid logging or transmitting it unless the user expects that behavior [Related Functions](https://docs.voltbz.net/docs/miscellaneous/gethwid#related-functions) ------------------------------------------------------------------------------------------ * [`identifyexecutor`](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor) - Get executor info [getfpscap\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/getfpscap) [identifyexecutor\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/gethwid#syntax) [Returns](https://docs.voltbz.net/docs/miscellaneous/gethwid#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/gethwid#description) [Example](https://docs.voltbz.net/docs/miscellaneous/gethwid#example) [Notes](https://docs.voltbz.net/docs/miscellaneous/gethwid#notes) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/gethwid#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) identifyexecutor ================ Returns information about Volt. [Syntax](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#syntax) ----------------------------------------------------------------------------- identifyexecutor() -> string, string [Returns](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#returns) ------------------------------------------------------------------------------- | Type | Description | | --- | --- | | `string` | Volt | | `string` | Version | [Description](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#description) --------------------------------------------------------------------------------------- `identifyexecutor` returns the name and version of Volt. [Example](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#example) ------------------------------------------------------------------------------- local name, version = identifyexecutor() print("Name:", name) print("Version:", version) [Aliases](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#aliases) ------------------------------------------------------------------------------- * `getexecutorname` [gethwid\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/gethwid) [messagebox\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/messagebox) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#syntax) [Returns](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#description) [Example](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#example) [Aliases](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor#aliases) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) messagebox ========== Displays a message box dialog. [Syntax](https://docs.voltbz.net/docs/miscellaneous/messagebox#syntax) ----------------------------------------------------------------------- messagebox(text: string, caption: string, flags: number) -> number [Parameters](https://docs.voltbz.net/docs/miscellaneous/messagebox#parameters) ------------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `text` | `string` | The message text | | `caption` | `string` | The window title | | `flags` | `number` | Button and icon flags accepted by the Windows `MessageBoxA` API | [Returns](https://docs.voltbz.net/docs/miscellaneous/messagebox#returns) ------------------------------------------------------------------------- | Type | Description | | --- | --- | | `number` | The button pressed by the user | [Description](https://docs.voltbz.net/docs/miscellaneous/messagebox#description) --------------------------------------------------------------------------------- `messagebox` displays a Windows-style message box with customizable buttons and icons. See Microsoft's [`MessageBoxA` documentation](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messageboxa#parameters) for the complete flag and return-value reference. [Common Flags](https://docs.voltbz.net/docs/miscellaneous/messagebox#common-flags) ----------------------------------------------------------------------------------- | Flag | Description | | --- | --- | | `0` | OK button | | `1` | OK + Cancel | | `4` | Yes + No | | `16` | Error icon | | `32` | Question icon | | `48` | Warning icon | | `64` | Info icon | [Return Values](https://docs.voltbz.net/docs/miscellaneous/messagebox#return-values) ------------------------------------------------------------------------------------- | Value | Description | | --- | --- | | `1` | OK | | `2` | Cancel | | `6` | Yes | | `7` | No | [Example](https://docs.voltbz.net/docs/miscellaneous/messagebox#example) ------------------------------------------------------------------------- -- Simple message messagebox("Hello!", "Greeting", 0) -- Confirmation dialog local result = messagebox("Are you sure?", "Confirm", 4 + 32) if result == 6 then print("User clicked Yes") else print("User clicked No") end -- Warning message messagebox("Something went wrong!", "Warning", 0 + 48) [Notes](https://docs.voltbz.net/docs/miscellaneous/messagebox#notes) --------------------------------------------------------------------- * Flags can be combined with addition * This is a yielding function [identifyexecutor\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor) [queueonteleport\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/queueonteleport) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/messagebox#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/messagebox#parameters) [Returns](https://docs.voltbz.net/docs/miscellaneous/messagebox#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/messagebox#description) [Common Flags](https://docs.voltbz.net/docs/miscellaneous/messagebox#common-flags) [Return Values](https://docs.voltbz.net/docs/miscellaneous/messagebox#return-values) [Example](https://docs.voltbz.net/docs/miscellaneous/messagebox#example) [Notes](https://docs.voltbz.net/docs/miscellaneous/messagebox#notes) --- # Volt Release Notes Volt 1.3 ======== Volt 1.3 adds UI 1.0, Account Manager, Game Explorer, Script Viewer, Save Instance, and the Luau decompiler. Volt 1.3 adds tools for inspecting games, viewing and decompiling scripts, saving instances, and managing account launches. It also includes executor API updates and UI 1.0. | Component | Version | | --- | --- | | Module | `1.3.0.0` | | UI | `1.0.0` | [Executor](https://docs.voltbz.net/docs/releases/1.3#executor) --------------------------------------------------------------- This release fixes various executor bugs and introduces new behavior across the runtime and API. Luau LSP types were also updated. ### [Runtime and API updates](https://docs.voltbz.net/docs/releases/1.3#runtime-and-api-updates) * Fixed issues affecting [`hookfunction`](https://docs.voltbz.net/docs/closures/hookfunction) , [`oth.hook`](https://docs.voltbz.net/docs/oth/hook) , RakNet packet hooks, auto-execution, workspace folder creation, and keyboard paste input. * Fixed `setfenv` interactions with [`setstackhidden`](https://docs.voltbz.net/docs/closures/setstackhidden) and `oth` hooks. * [`gethiddenproperty`](https://docs.voltbz.net/docs/reflection/gethiddenproperty) , [`gethiddenproperties`](https://docs.voltbz.net/docs/reflection/gethiddenproperties) , [`sethiddenproperty`](https://docs.voltbz.net/docs/reflection/sethiddenproperty) , [`getproperties`](https://docs.voltbz.net/docs/reflection/getproperties) , [`isscriptable`](https://docs.voltbz.net/docs/reflection/isscriptable) , [`setscriptable`](https://docs.voltbz.net/docs/reflection/setscriptable) , and [`getcallbackvalue`](https://docs.voltbz.net/docs/instances/getcallbackvalue) now accept `Object` instead of only `Instance`. * [`getconnections`](https://docs.voltbz.net/docs/signals/getconnections) now works with non-scriptable signals. * [`getscriptbytecode`](https://docs.voltbz.net/docs/scripts/getscriptbytecode) , [`getscriptclosure`](https://docs.voltbz.net/docs/scripts/getscriptclosure) , and [`getscripthash`](https://docs.voltbz.net/docs/scripts/getscripthash) now support CoreScripts. * Added [`raknet.is_enabled(): boolean`](https://docs.voltbz.net/docs/raknet) . * Added [`setrbxclipboard(data: any)`](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard) for copying Studio-compatible data. * Added [`saveinstance`](https://docs.voltbz.net/docs/miscellaneous/saveinstance) and [`saveplace`](https://docs.voltbz.net/docs/miscellaneous/saveplace) . [Internal UI](https://docs.voltbz.net/docs/releases/1.3#internal-ui) --------------------------------------------------------------------- Volt 1.3 adds Game Explorer and Script Viewer to the internal UI. It also uses themes from the desktop interface for consistent styling. Volt DarkCatppuccin MochaSakura Drift ![Volt internal UI using the Volt Dark theme](https://docs.voltbz.net/img/internal-ui-volt-dark.png) ![Volt internal UI using the Catppuccin Mocha theme](https://docs.voltbz.net/img/internal-ui-catppuccin-mocha.png) ![Volt internal UI using the Sakura Drift theme](https://docs.voltbz.net/img/internal-ui-sakura-drift.png) ### [Game Explorer](https://docs.voltbz.net/docs/releases/1.3#game-explorer) Game Explorer shows the live game tree and a properties panel for viewing and editing the selected instances. * Hold `CTRL` to select multiple instances. * Use the instance context menu to copy, rename, or paste into an instance. * Use **Copy Path** to copy a Luau path for a property. * Use **Copy Name** to copy only the property name. * Use **Copy Value** to copy the value in Luau format. * Tags and attributes can be removed from their context menus. * **Save Place** displays progress while the place is being written. ### [Script Viewer](https://docs.voltbz.net/docs/releases/1.3#script-viewer) Script Viewer displays decompiled script output with variable renaming, reference navigation, and bracket pair colorization. * Right-click a variable or press `X` to view its references. * Press `R` to rename the selected variable. [Decompiler](https://docs.voltbz.net/docs/releases/1.3#decompiler) ------------------------------------------------------------------- Volt 1.3 introduces a built-in Luau decompiler. [`decompile`](https://docs.voltbz.net/docs/scripts/decompile) accepts a script or raw Luau bytecode and returns source text. * [`DecompilerOptions`](https://docs.voltbz.net/docs/scripts/decompile#decompileroptions) controls variable naming, function declarations, guard clauses, conditional structuring, constant folding, scope block insertion, and formatting. * [`DecompilerFormatter`](https://docs.voltbz.net/docs/scripts/decompile#decompilerformatter) controls indentation, column limit, condition parentheses, semicolons, and function metadata. The decompiler is still in development, so some bugs are expected. See the [Decompiler guide](https://docs.voltbz.net/docs/decompiler) for usage details and current behavior. [Save Instance](https://docs.voltbz.net/docs/releases/1.3#save-instance) ------------------------------------------------------------------------- [`saveinstance`](https://docs.voltbz.net/docs/miscellaneous/saveinstance) and [`saveplace`](https://docs.voltbz.net/docs/miscellaneous/saveplace) export instance hierarchies using the game's binary serialization format. They can run from scripts or from the internal UI. Use [`SaveInstanceOptions`](https://docs.voltbz.net/docs/miscellaneous/saveinstance#saveinstanceoptions) to configure: * Output file path * Script decompilation * Clipboard output * An `IgnoreList` property (currently readable, but not assignable from Luau) * Decompiler options * Player and character filters * Nil instance filters * Non-creatable instance filters [Desktop UI 1.0](https://docs.voltbz.net/docs/releases/1.3#desktop-ui-10) -------------------------------------------------------------------------- UI 1.0 introduces a redesigned desktop interface with a more compact layout, refreshed branding, updated app icons, and a cleaner default theme. ![Volt UI 1.0 home and setup screen](https://docs.voltbz.net/img/home.png) Home and setup view ![Volt UI 1.0 editor screen](https://docs.voltbz.net/img/editor.png) Editor view ### [Workspace](https://docs.voltbz.net/docs/releases/1.3#workspace) * Pinned tabs, with Home pinned by default, and dedicated pinned-tab controls. * Saved layouts that restore splits, open tabs, pane sizes, sidebar and terminal state, window placement, and unsaved tabs. * Detachable Terminals, Account Manager, and Theme Editor windows. Terminals include search and filtering, connection status, and topmost mode. * Instance groups, including an `All` group, with support for binding tabs to a group. * A searchable command palette for common actions. ### [Editor and files](https://docs.voltbz.net/docs/releases/1.3#editor-and-files) * Editor breadcrumbs with folder and file navigation. * Separate Scripts and Autoexec trees with search and folder creation. * Drag-and-drop file organization and support for opening external `.txt`, `.lua`, and `.luau` files. * Installed system font detection and font selection in Settings. * Dynamic source maps that keep Luau LSP completions and types synchronized with the live game tree. ### [Setup and settings](https://docs.voltbz.net/docs/releases/1.3#setup-and-settings) * One-click setup from Home, supported game version checks, and prompts to install the required version when needed. * Background Volt update checks and an API health check during startup. * Decompiler settings with live output previews and Save Instance default settings. * Theme schema v3 with expanded customization and theme import and export. * Windows 7 Aero, Volt Ware, and Voltmillion themes, with updated built-in Monaco styling. * A Theme Editor with collapsible sections and a responsive color picker, plus a keybind editor for the internal UI. [Account Manager](https://docs.voltbz.net/docs/releases/1.3#account-manager) ----------------------------------------------------------------------------- Volt 1.3 introduces Account Manager as a public feature. It stores accounts, launches multiple clients, tracks running instances, and manages private server launches. ![Volt Account Manager launch settings and account table](https://docs.voltbz.net/img/account_manager_1.png) Launch settings and account table ![Volt Account Manager compact performance overlay](https://docs.voltbz.net/img/overlay_1.png) Performance overlay It includes: * Browser login and bulk cookie import, with protected cookie storage and cookie health checks. * Multi-account launching with launch delays, stop controls, connection tracking, and Place ID validation. * Private server launching with none, round-robin, and assigned server modes. * Automatic relaunching for closed instances, with relaunch countdowns. * Per-account and total CPU and memory usage. * A configurable performance overlay showing account status, process count, CPU and memory usage, and relaunch state. * Memory Guard with automatic and fixed committed-memory limits. * Autosaved launch and private server settings. [Related docs](https://docs.voltbz.net/docs/releases/1.3#related-docs) ----------------------------------------------------------------------- * [Decompiler](https://docs.voltbz.net/docs/decompiler) * [Save Instance](https://docs.voltbz.net/docs/miscellaneous/saveinstance) * [Account Manager](https://docs.voltbz.net/docs/account-manager) [Release Notes\ \ Major Volt releases in one place. Each release note keeps the important changes, upgrade context, and compatibility notes easy to scan.](https://docs.voltbz.net/docs/releases) ### On this page [Executor](https://docs.voltbz.net/docs/releases/1.3#executor) [Runtime and API updates](https://docs.voltbz.net/docs/releases/1.3#runtime-and-api-updates) [Internal UI](https://docs.voltbz.net/docs/releases/1.3#internal-ui) [Game Explorer](https://docs.voltbz.net/docs/releases/1.3#game-explorer) [Script Viewer](https://docs.voltbz.net/docs/releases/1.3#script-viewer) [Decompiler](https://docs.voltbz.net/docs/releases/1.3#decompiler) [Save Instance](https://docs.voltbz.net/docs/releases/1.3#save-instance) [Desktop UI 1.0](https://docs.voltbz.net/docs/releases/1.3#desktop-ui-10) [Workspace](https://docs.voltbz.net/docs/releases/1.3#workspace) [Editor and files](https://docs.voltbz.net/docs/releases/1.3#editor-and-files) [Setup and settings](https://docs.voltbz.net/docs/releases/1.3#setup-and-settings) [Account Manager](https://docs.voltbz.net/docs/releases/1.3#account-manager) [Related docs](https://docs.voltbz.net/docs/releases/1.3#related-docs) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) queueonteleport =============== Queues a script to run after teleporting. [Syntax](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#syntax) ---------------------------------------------------------------------------- queueonteleport(script: string) -> () [Aliases](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#aliases) ------------------------------------------------------------------------------ * `queue_on_teleport` * `queueteleport` [Parameters](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#parameters) ------------------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `script` | `string` | The Luau code to run after teleport | [Returns](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#returns) ------------------------------------------------------------------------------ This function does not return a value. [Description](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#description) -------------------------------------------------------------------------------------- `queueonteleport` queues Luau code to be executed after the player teleports to another place. The script will run once the new place loads. [Example](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#example) ------------------------------------------------------------------------------ -- Queue a script to run after teleporting queueonteleport([[\ print("Teleported successfully!")\ -- Your script code here\ ]]) -- Teleport the player game:GetService("TeleportService"):Teleport(placeId) [Auto-Execute Example](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#auto-execute-example) -------------------------------------------------------------------------------------------------------- -- Queue the current script to run again queueonteleport(game:HttpGet("https://example.com/script.luau")) [Notes](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#notes) -------------------------------------------------------------------------- * Use `clearqueueonteleport` to clear the queue * Every queued script is removed by `clearqueueonteleport` [Related Functions](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#related-functions) -------------------------------------------------------------------------------------------------- * [`clearqueueonteleport`](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport) - Clear the queue [messagebox\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/messagebox) [request\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/request) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#syntax) [Aliases](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#aliases) [Parameters](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#parameters) [Returns](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#description) [Example](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#example) [Auto-Execute Example](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#auto-execute-example) [Notes](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#notes) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/queueonteleport#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) request ======= Sends an HTTP request and yields until the response is available. [Syntax](https://docs.voltbz.net/docs/miscellaneous/request#syntax) -------------------------------------------------------------------- request(options: table) -> table [Parameters](https://docs.voltbz.net/docs/miscellaneous/request#parameters) ---------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `options` | `table` | Request configuration | ### [Options Table](https://docs.voltbz.net/docs/miscellaneous/request#options-table) | Field | Type | Description | | --- | --- | --- | | `Url` | `string` | The URL to request | | `Method` | `string?` | HTTP method; defaults to `GET` | | `Headers` | `table?` | Request headers | | `Body` | `string?` | Request body | [Returns](https://docs.voltbz.net/docs/miscellaneous/request#returns) ---------------------------------------------------------------------- ### [Response Table](https://docs.voltbz.net/docs/miscellaneous/request#response-table) | Field | Type | Description | | --- | --- | --- | | `Success` | `boolean` | Whether the request succeeded | | `StatusCode` | `number` | HTTP status code | | `StatusMessage` | `string` | HTTP status message | | `Headers` | `table` | Response headers | | `Body` | `string` | Response body | [Example: GET Request](https://docs.voltbz.net/docs/miscellaneous/request#example-get-request) ----------------------------------------------------------------------------------------------- local response = request({ Url = "https://httpbin.org/get", Method = "GET" }) if response.Success then print("Status:", response.StatusCode) print("Body:", response.Body) end [Example: POST Request](https://docs.voltbz.net/docs/miscellaneous/request#example-post-request) ------------------------------------------------------------------------------------------------- local HttpService = game:GetService("HttpService") local response = request({ Url = "https://httpbin.org/post", Method = "POST", Headers = { ["Content-Type"] = "application/json" }, Body = HttpService:JSONEncode({ username = "player", score = 100 }) }) if response.Success then local data = HttpService:JSONDecode(response.Body) print(data) end [Error Handling](https://docs.voltbz.net/docs/miscellaneous/request#error-handling) ------------------------------------------------------------------------------------ local success, response = pcall(request, { Url = "https://example.com/api", Method = "GET" }) if success and response.Success then print("Got data:", response.Body) elseif success then warn("HTTP Error:", response.StatusCode, response.StatusMessage) else warn("Request failed:", response) end [Aliases](https://docs.voltbz.net/docs/miscellaneous/request#aliases) ---------------------------------------------------------------------- * `http_request` * `http.request` [queueonteleport\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/queueonteleport) [saveinstance\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/saveinstance) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/request#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/request#parameters) [Options Table](https://docs.voltbz.net/docs/miscellaneous/request#options-table) [Returns](https://docs.voltbz.net/docs/miscellaneous/request#returns) [Response Table](https://docs.voltbz.net/docs/miscellaneous/request#response-table) [Example: GET Request](https://docs.voltbz.net/docs/miscellaneous/request#example-get-request) [Example: POST Request](https://docs.voltbz.net/docs/miscellaneous/request#example-post-request) [Error Handling](https://docs.voltbz.net/docs/miscellaneous/request#error-handling) [Aliases](https://docs.voltbz.net/docs/miscellaneous/request#aliases) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) saveplace ========= Serializes the current DataModel to the game's binary place format. [Syntax](https://docs.voltbz.net/docs/miscellaneous/saveplace#syntax) ---------------------------------------------------------------------- saveplace(options: SaveInstanceOptions?) -> () [Parameters](https://docs.voltbz.net/docs/miscellaneous/saveplace#parameters) ------------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `options` | `SaveInstanceOptions?` | Optional settings created with `SaveInstanceOptions.new()` | [Description](https://docs.voltbz.net/docs/miscellaneous/saveplace#description) -------------------------------------------------------------------------------- `saveplace` saves the current place as a binary `.rbxl` file. If `FilePath` is empty, Volt generates a filename. If a supplied path has no extension, `.rbxl` is appended; an existing extension is left unchanged. See [`saveinstance`](https://docs.voltbz.net/docs/miscellaneous/saveinstance#saveinstanceoptions) for every option. [Example](https://docs.voltbz.net/docs/miscellaneous/saveplace#example) ------------------------------------------------------------------------ local options = SaveInstanceOptions.new() options.FilePath = "exports/current-place.rbxl" options.SaveNilInstances = false options.SavePlayerCharacters = false options.SavePlayers = false saveplace(options) print(isfile("exports/current-place.rbxl")) -- true Options may be omitted: saveplace() [Related Functions](https://docs.voltbz.net/docs/miscellaneous/saveplace#related-functions) -------------------------------------------------------------------------------------------- * [`saveinstance`](https://docs.voltbz.net/docs/miscellaneous/saveinstance) - Serialize an instance or selection [saveinstance\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/saveinstance) [setclipboard\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/setclipboard) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/saveplace#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/saveplace#parameters) [Description](https://docs.voltbz.net/docs/miscellaneous/saveplace#description) [Example](https://docs.voltbz.net/docs/miscellaneous/saveplace#example) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/saveplace#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) saveinstance ============ Serializes one or more instances to the game's binary model or place format. [Syntax](https://docs.voltbz.net/docs/miscellaneous/saveinstance#syntax) ------------------------------------------------------------------------- saveinstance(root: Instance | {Instance}, options: SaveInstanceOptions?) -> () SaveInstanceOptions.new() -> SaveInstanceOptions [Parameters](https://docs.voltbz.net/docs/miscellaneous/saveinstance#parameters) --------------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `root` | `Instance \| {Instance}` | An instance hierarchy, the DataModel, or an array of instances | | `options` | `SaveInstanceOptions?` | Optional serialization settings | `options` must be a `SaveInstanceOptions` value created with `SaveInstanceOptions.new()`. Plain tables are not accepted. [Behavior](https://docs.voltbz.net/docs/miscellaneous/saveinstance#behavior) ----------------------------------------------------------------------------- * Instances and arrays are saved as binary model files. Passing `game` saves a binary place file. * If `FilePath` has no extension, Volt appends `.rbxm` for a model or `.rbxl` for a place. An existing extension is not validated or replaced. * If `FilePath` is empty and clipboard output is disabled, Volt generates a filename. [SaveInstanceOptions](https://docs.voltbz.net/docs/miscellaneous/saveinstance#saveinstanceoptions) --------------------------------------------------------------------------------------------------- | Property | Type | Default | Description | | --- | --- | --- | --- | | `FilePath` | `string` | `""` | Workspace-relative output path | | `IgnoreArchivable` | `boolean` | `false` | Serialize instances regardless of `Archivable` | | `SavePlayerCharacters` | `boolean` | `false` | Include player characters in place output | | `SavePlayers` | `boolean` | `false` | Include `Player` instances and their non-creatable descendants | | `DisableCompression` | `boolean` | `false` | Disable binary compression | | `DecompileScripts` | `boolean` | `true` | Store decompiled source for scripts when possible | | `SaveNonCreatable` | `boolean` | `false` | Represent non-creatable instances as folders | | `SaveNilInstances` | `boolean` | `false` | Include cached nil-parented instances in place output | | `CopyToClipboard` | `boolean` | `false` | Copy binary output to the Studio clipboard | | `IgnoreList` | `{Instance}` | `{}` | Instances to exclude from the save | | `DecompilerOptions` | `DecompilerOptions` | New default options | Options used when `DecompileScripts` is enabled | Assign a complete table to `IgnoreList`. Reading the property returns a read-only copy, so create or modify a separate table and assign it back when changing the list. [Example](https://docs.voltbz.net/docs/miscellaneous/saveinstance#example) --------------------------------------------------------------------------- local model = Instance.new("Model") model.Name = "ExampleModel" local part = Instance.new("Part") part.Name = "ExamplePart" part.Parent = model local options = SaveInstanceOptions.new() options.FilePath = "exports/example-model.rbxm" options.IgnoreArchivable = false options.DecompileScripts = true saveinstance(model, options) print(isfile("exports/example-model.rbxm")) -- true model:Destroy() [Saving Multiple Roots](https://docs.voltbz.net/docs/miscellaneous/saveinstance#saving-multiple-roots) ------------------------------------------------------------------------------------------------------- local options = SaveInstanceOptions.new() options.FilePath = "exports/selection.rbxm" saveinstance({workspace.Terrain, workspace.CurrentCamera}, options) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/saveinstance#related-functions) ----------------------------------------------------------------------------------------------- * [`saveplace`](https://docs.voltbz.net/docs/miscellaneous/saveplace) - Serialize the current place * [`decompile`](https://docs.voltbz.net/docs/scripts/decompile) - Configure script decompilation [request\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/request) [saveplace\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/saveplace) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/saveinstance#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/saveinstance#parameters) [Behavior](https://docs.voltbz.net/docs/miscellaneous/saveinstance#behavior) [SaveInstanceOptions](https://docs.voltbz.net/docs/miscellaneous/saveinstance#saveinstanceoptions) [Example](https://docs.voltbz.net/docs/miscellaneous/saveinstance#example) [Saving Multiple Roots](https://docs.voltbz.net/docs/miscellaneous/saveinstance#saving-multiple-roots) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/saveinstance#related-functions) --- # Volt Documentation [Environment](https://docs.voltbz.net/docs/environment) filtergc ======== Filters objects in the garbage collector based on specified criteria. [Syntax](https://docs.voltbz.net/docs/environment/filtergc#syntax) ------------------------------------------------------------------- filtergc(type: "function" | "table", options: table, returnOne?: boolean) -> any? | {any} [Parameters](https://docs.voltbz.net/docs/environment/filtergc#parameters) --------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `type` | `string` | The type of object to find ("function" or "table") | | `options` | `table` | Filter options | | `returnOne` | `boolean?` | Return the first match instead of an array (default: false) | [Returns](https://docs.voltbz.net/docs/environment/filtergc#returns) --------------------------------------------------------------------- | Type | Description | | --- | --- | | `any?` or `table` | The first match when `returnOne` is true; otherwise an array of matches | [Description](https://docs.voltbz.net/docs/environment/filtergc#description) ----------------------------------------------------------------------------- `filtergc` efficiently searches through garbage-collected objects with specific filter criteria. This is more performant than manually iterating through `getgc()`. [Function Filter Options](https://docs.voltbz.net/docs/environment/filtergc#function-filter-options) ----------------------------------------------------------------------------------------------------- | Option | Type | Description | | --- | --- | --- | | `Name` | `string` | Match function name | | `Constants` | `table` | Match constants in function | | `Upvalues` | `table` | Match upvalue values | | `Hash` | `string` | Match the value returned by `getfunctionhash` | | `IgnoreExecutor` | `boolean` | Exclude Volt-created functions (default: true) | | `Environment` | `table` | Match the function's global environment | | `StartLine` | `number` | Match the function's starting source line | | `Source` | `string` | Match the function's short source name | | `UpvalueCount` | `number` | Match the exact upvalue count | | `ConstantCount` | `number` | Match the exact constant count | [Table Filter Options](https://docs.voltbz.net/docs/environment/filtergc#table-filter-options) ----------------------------------------------------------------------------------------------- | Option | Type | Description | | --- | --- | --- | | `Keys` | `table` | Match table keys | | `Values` | `table` | Match table values | | `KeyValuePairs` | `table` | Match key-value pairs | | `Metatable` | `table` | Match metatable | [Example: Find Function by Name](https://docs.voltbz.net/docs/environment/filtergc#example-find-function-by-name) ------------------------------------------------------------------------------------------------------------------ local functions = filtergc("function", { Name = "targetFunction", IgnoreExecutor = false }) for _, func in ipairs(functions) do print("Found:", func) end [Example: Find Function by Constants](https://docs.voltbz.net/docs/environment/filtergc#example-find-function-by-constants) ---------------------------------------------------------------------------------------------------------------------------- local functions = filtergc("function", { Constants = {"SomeUniqueString", "AnotherString"}, IgnoreExecutor = false }) [Example: Find Table by Keys](https://docs.voltbz.net/docs/environment/filtergc#example-find-table-by-keys) ------------------------------------------------------------------------------------------------------------ local tables = filtergc("table", { Keys = {"Health", "MaxHealth", "Damage"} }) for _, tbl in ipairs(tables) do print("Found table with game stats") end [Example: Return the First Match](https://docs.voltbz.net/docs/environment/filtergc#example-return-the-first-match) -------------------------------------------------------------------------------------------------------------------- local function targetFunction() return "unique constant" end local match = filtergc("function", { Name = "targetFunction", IgnoreExecutor = false }, true) print(match == targetFunction) -- true [Notes](https://docs.voltbz.net/docs/environment/filtergc#notes) ----------------------------------------------------------------- * Function filters narrow the result: every supplied criterion must match * `Constants`, `Upvalues`, and `Hash` do not apply to C closures [Related Functions](https://docs.voltbz.net/docs/environment/filtergc#related-functions) ----------------------------------------------------------------------------------------- * [`getgc`](https://docs.voltbz.net/docs/environment/getgc) - Get all GC objects [Environment\ \ Previous Page](https://docs.voltbz.net/docs/environment) [getallthreads\ \ Next Page](https://docs.voltbz.net/docs/environment/getallthreads) ### On this page [Syntax](https://docs.voltbz.net/docs/environment/filtergc#syntax) [Parameters](https://docs.voltbz.net/docs/environment/filtergc#parameters) [Returns](https://docs.voltbz.net/docs/environment/filtergc#returns) [Description](https://docs.voltbz.net/docs/environment/filtergc#description) [Function Filter Options](https://docs.voltbz.net/docs/environment/filtergc#function-filter-options) [Table Filter Options](https://docs.voltbz.net/docs/environment/filtergc#table-filter-options) [Example: Find Function by Name](https://docs.voltbz.net/docs/environment/filtergc#example-find-function-by-name) [Example: Find Function by Constants](https://docs.voltbz.net/docs/environment/filtergc#example-find-function-by-constants) [Example: Find Table by Keys](https://docs.voltbz.net/docs/environment/filtergc#example-find-table-by-keys) [Example: Return the First Match](https://docs.voltbz.net/docs/environment/filtergc#example-return-the-first-match) [Notes](https://docs.voltbz.net/docs/environment/filtergc#notes) [Related Functions](https://docs.voltbz.net/docs/environment/filtergc#related-functions) --- # Volt Documentation [Environment](https://docs.voltbz.net/docs/environment) getreg ====== Returns the Luau registry table. [Syntax](https://docs.voltbz.net/docs/environment/getreg#syntax) ----------------------------------------------------------------- getreg() -> table [Aliases](https://docs.voltbz.net/docs/environment/getreg#aliases) ------------------------------------------------------------------- * `getregistry` [Returns](https://docs.voltbz.net/docs/environment/getreg#returns) ------------------------------------------------------------------- | Type | Description | | --- | --- | | `table` | The Luau registry | [Description](https://docs.voltbz.net/docs/environment/getreg#description) --------------------------------------------------------------------------- `getreg` returns the Luau registry, a special table used internally by Luau to store references. This can contain connections, threads, and other internal objects. [Example](https://docs.voltbz.net/docs/environment/getreg#example) ------------------------------------------------------------------- local registry = getreg() for i, v in pairs(registry) do print(i, type(v), v) end [Finding Connections](https://docs.voltbz.net/docs/environment/getreg#finding-connections) ------------------------------------------------------------------------------------------- -- Find all RBXScriptConnections in the registry local connections = {} for _, v in pairs(getreg()) do if type(v) == "table" then for _, item in pairs(v) do local t = typeof(item) if t == "RBXScriptConnection" then table.insert(connections, item) end end end end print("Found", #connections, "connections") [Notes](https://docs.voltbz.net/docs/environment/getreg#notes) --------------------------------------------------------------- * The registry contains internal Luau objects * Modifying the registry can cause undefined behavior * Use with caution and primarily for reading [Related Functions](https://docs.voltbz.net/docs/environment/getreg#related-functions) --------------------------------------------------------------------------------------- * [`getgenv`](https://docs.voltbz.net/docs/environment/getgenv) - Get Volt's environment * [`getrenv`](https://docs.voltbz.net/docs/environment/getrenv) - Get game environment [getgenv\ \ Previous Page](https://docs.voltbz.net/docs/environment/getgenv) [getrenv\ \ Next Page](https://docs.voltbz.net/docs/environment/getrenv) ### On this page [Syntax](https://docs.voltbz.net/docs/environment/getreg#syntax) [Aliases](https://docs.voltbz.net/docs/environment/getreg#aliases) [Returns](https://docs.voltbz.net/docs/environment/getreg#returns) [Description](https://docs.voltbz.net/docs/environment/getreg#description) [Example](https://docs.voltbz.net/docs/environment/getreg#example) [Finding Connections](https://docs.voltbz.net/docs/environment/getreg#finding-connections) [Notes](https://docs.voltbz.net/docs/environment/getreg#notes) [Related Functions](https://docs.voltbz.net/docs/environment/getreg#related-functions) --- # Volt Documentation [Environment](https://docs.voltbz.net/docs/environment) gettenv ======= Gets the environment of a thread. [Syntax](https://docs.voltbz.net/docs/environment/gettenv#syntax) ------------------------------------------------------------------ gettenv(thread: thread?) -> table? [Parameters](https://docs.voltbz.net/docs/environment/gettenv#parameters) -------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `thread` | `thread` | (Optional) Thread, defaults to current | [Returns](https://docs.voltbz.net/docs/environment/gettenv#returns) -------------------------------------------------------------------- | Type | Description | | --- | --- | | `table?` | The thread's environment, or nil for a thread from another Luau state | [Description](https://docs.voltbz.net/docs/environment/gettenv#description) ---------------------------------------------------------------------------- `gettenv` returns the environment table for the specified thread. It defaults to the current thread. A thread whose main state differs from the caller's returns nil. [Example](https://docs.voltbz.net/docs/environment/gettenv#example) -------------------------------------------------------------------- -- Get current thread's environment local env = gettenv() print(env.print) -- The print function -- Get another thread's environment local thread = coroutine.create(function() end) local threadEnv = gettenv(thread) print(threadEnv ~= nil) -- true [Related Functions](https://docs.voltbz.net/docs/environment/gettenv#related-functions) ---------------------------------------------------------------------------------------- * [`getgenv`](https://docs.voltbz.net/docs/environment/getgenv) - Get global environment * [`getrenv`](https://docs.voltbz.net/docs/environment/getrenv) - Get the game environment [getrenv\ \ Previous Page](https://docs.voltbz.net/docs/environment/getrenv) [Bit\ \ Next Page](https://docs.voltbz.net/docs/bit) ### On this page [Syntax](https://docs.voltbz.net/docs/environment/gettenv#syntax) [Parameters](https://docs.voltbz.net/docs/environment/gettenv#parameters) [Returns](https://docs.voltbz.net/docs/environment/gettenv#returns) [Description](https://docs.voltbz.net/docs/environment/gettenv#description) [Example](https://docs.voltbz.net/docs/environment/gettenv#example) [Related Functions](https://docs.voltbz.net/docs/environment/gettenv#related-functions) --- # Volt Documentation [Environment](https://docs.voltbz.net/docs/environment) getrenv ======= Returns the game's global environment table. [Syntax](https://docs.voltbz.net/docs/environment/getrenv#syntax) ------------------------------------------------------------------ getrenv() -> table [Returns](https://docs.voltbz.net/docs/environment/getrenv#returns) -------------------------------------------------------------------- | Type | Description | | --- | --- | | `table` | The game's global environment | [Description](https://docs.voltbz.net/docs/environment/getrenv#description) ---------------------------------------------------------------------------- `getrenv` returns the global environment used by game scripts. This contains standard globals such as `game`, `workspace`, and `Instance`. [Example](https://docs.voltbz.net/docs/environment/getrenv#example) -------------------------------------------------------------------- local renv = getrenv() -- Access game globals print(renv.game) -- Same as game print(renv.workspace) -- Same as workspace print(renv.Instance) -- Same as Instance [Finding Game Globals](https://docs.voltbz.net/docs/environment/getrenv#finding-game-globals) ---------------------------------------------------------------------------------------------- -- List all globals in the game environment local renv = getrenv() for name, value in pairs(renv) do print(name, type(value)) end [Difference from getgenv](https://docs.voltbz.net/docs/environment/getrenv#difference-from-getgenv) ---------------------------------------------------------------------------------------------------- | `getrenv()` | `getgenv()` | | --- | --- | | Game's environment | Volt's environment | | Contains game globals | Contains Volt globals | | Read-only access recommended | Can freely modify | [Checking for Global Modifications](https://docs.voltbz.net/docs/environment/getrenv#checking-for-global-modifications) ------------------------------------------------------------------------------------------------------------------------ -- Check if game modified a global local renv = getrenv() if renv.print ~= print then warn("print function was modified!") end [Related Functions](https://docs.voltbz.net/docs/environment/getrenv#related-functions) ---------------------------------------------------------------------------------------- * [`getgenv`](https://docs.voltbz.net/docs/environment/getgenv) - Get Volt's environment * [`getsenv`](https://docs.voltbz.net/docs/scripts/getsenv) - Get a script's environment [getreg\ \ Previous Page](https://docs.voltbz.net/docs/environment/getreg) [gettenv\ \ Next Page](https://docs.voltbz.net/docs/environment/gettenv) ### On this page [Syntax](https://docs.voltbz.net/docs/environment/getrenv#syntax) [Returns](https://docs.voltbz.net/docs/environment/getrenv#returns) [Description](https://docs.voltbz.net/docs/environment/getrenv#description) [Example](https://docs.voltbz.net/docs/environment/getrenv#example) [Finding Game Globals](https://docs.voltbz.net/docs/environment/getrenv#finding-game-globals) [Difference from getgenv](https://docs.voltbz.net/docs/environment/getrenv#difference-from-getgenv) [Checking for Global Modifications](https://docs.voltbz.net/docs/environment/getrenv#checking-for-global-modifications) [Related Functions](https://docs.voltbz.net/docs/environment/getrenv#related-functions) --- # Volt Documentation [Environment](https://docs.voltbz.net/docs/environment) getgenv ======= Returns Volt's global environment table. [Syntax](https://docs.voltbz.net/docs/environment/getgenv#syntax) ------------------------------------------------------------------ getgenv() -> table [Returns](https://docs.voltbz.net/docs/environment/getgenv#returns) -------------------------------------------------------------------- | Type | Description | | --- | --- | | `table` | Volt's global environment | [Description](https://docs.voltbz.net/docs/environment/getgenv#description) ---------------------------------------------------------------------------- `getgenv` returns the global environment table used by Volt. Variables stored here persist across different script executions and can be accessed by all scripts running in Volt. [Example](https://docs.voltbz.net/docs/environment/getgenv#example) -------------------------------------------------------------------- -- Store a value in the Volt environment getgenv().myGlobalValue = "Hello from script 1" -- Later, in another script execution print(getgenv().myGlobalValue) -- "Hello from script 1" [Shared State](https://docs.voltbz.net/docs/environment/getgenv#shared-state) ------------------------------------------------------------------------------ -- Script 1: Initialize shared state getgenv().SharedData = { players = {}, settings = { enabled = true } } -- Script 2: Access shared state if getgenv().SharedData then print("Settings:", getgenv().SharedData.settings.enabled) end [Checking if Script Already Ran](https://docs.voltbz.net/docs/environment/getgenv#checking-if-script-already-ran) ------------------------------------------------------------------------------------------------------------------ if getgenv().MyScriptLoaded then warn("Script already running!") return end getgenv().MyScriptLoaded = true -- Rest of your script... [Related Functions](https://docs.voltbz.net/docs/environment/getgenv#related-functions) ---------------------------------------------------------------------------------------- * [`getrenv`](https://docs.voltbz.net/docs/environment/getrenv) - Get game's environment * [`getsenv`](https://docs.voltbz.net/docs/scripts/getsenv) - Get a script's environment [getgc\ \ Previous Page](https://docs.voltbz.net/docs/environment/getgc) [getreg\ \ Next Page](https://docs.voltbz.net/docs/environment/getreg) ### On this page [Syntax](https://docs.voltbz.net/docs/environment/getgenv#syntax) [Returns](https://docs.voltbz.net/docs/environment/getgenv#returns) [Description](https://docs.voltbz.net/docs/environment/getgenv#description) [Example](https://docs.voltbz.net/docs/environment/getgenv#example) [Shared State](https://docs.voltbz.net/docs/environment/getgenv#shared-state) [Checking if Script Already Ran](https://docs.voltbz.net/docs/environment/getgenv#checking-if-script-already-ran) [Related Functions](https://docs.voltbz.net/docs/environment/getgenv#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) setfpscap ========= Sets the FPS cap for the game. [Syntax](https://docs.voltbz.net/docs/miscellaneous/setfpscap#syntax) ---------------------------------------------------------------------- setfpscap(fps: number) -> () [Parameters](https://docs.voltbz.net/docs/miscellaneous/setfpscap#parameters) ------------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `fps` | `number` | The FPS cap to set | [Returns](https://docs.voltbz.net/docs/miscellaneous/setfpscap#returns) ------------------------------------------------------------------------ This function does not return a value. [Description](https://docs.voltbz.net/docs/miscellaneous/setfpscap#description) -------------------------------------------------------------------------------- `setfpscap` sets the maximum frame rate. Pass `0` to remove the cap. [Example](https://docs.voltbz.net/docs/miscellaneous/setfpscap#example) ------------------------------------------------------------------------ -- Cap at 60 FPS setfpscap(60) -- Remove the cap setfpscap(0) -- Cap at 144 FPS setfpscap(144) [Notes](https://docs.voltbz.net/docs/miscellaneous/setfpscap#notes) -------------------------------------------------------------------- * The value must be non-negative * Higher FPS may increase CPU/GPU usage [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setfpscap#related-functions) -------------------------------------------------------------------------------------------- * [`getfpscap`](https://docs.voltbz.net/docs/miscellaneous/getfpscap) - Get current FPS cap [setfflag\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/setfflag) [setrbxclipboard\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/setfpscap#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/setfpscap#parameters) [Returns](https://docs.voltbz.net/docs/miscellaneous/setfpscap#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/setfpscap#description) [Example](https://docs.voltbz.net/docs/miscellaneous/setfpscap#example) [Notes](https://docs.voltbz.net/docs/miscellaneous/setfpscap#notes) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setfpscap#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) setfflag ======== Sets a Fast Flag value. [Syntax](https://docs.voltbz.net/docs/miscellaneous/setfflag#syntax) --------------------------------------------------------------------- setfflag(name: string, value: string) -> () [Parameters](https://docs.voltbz.net/docs/miscellaneous/setfflag#parameters) ----------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `name` | `string` | The flag name | | `value` | `string` | The value to set | [Returns](https://docs.voltbz.net/docs/miscellaneous/setfflag#returns) ----------------------------------------------------------------------- This function does not return a value. [Description](https://docs.voltbz.net/docs/miscellaneous/setfflag#description) ------------------------------------------------------------------------------- `setfflag` sets the value of a Fast Flag (FFlag). These flags control various engine features and behaviors. [Example](https://docs.voltbz.net/docs/miscellaneous/setfflag#example) ----------------------------------------------------------------------- -- Enable a flag setfflag("DFIntTaskSchedulerTargetFps", "240") -- Disable graphics features setfflag("FFlagDebugDisableTelemetryEphemeralCounter", "true") [Notes](https://docs.voltbz.net/docs/miscellaneous/setfflag#notes) ------------------------------------------------------------------- * Flag names are case-sensitive * Values are always strings * Some flags require restart to take effect * Not all flags can be modified [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setfflag#related-functions) ------------------------------------------------------------------------------------------- * [`getfflag`](https://docs.voltbz.net/docs/miscellaneous/getfflag) - Get flag value [setclipboard\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/setclipboard) [setfpscap\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/setfpscap) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/setfflag#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/setfflag#parameters) [Returns](https://docs.voltbz.net/docs/miscellaneous/setfflag#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/setfflag#description) [Example](https://docs.voltbz.net/docs/miscellaneous/setfflag#example) [Notes](https://docs.voltbz.net/docs/miscellaneous/setfflag#notes) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setfflag#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) setrbxclipboard =============== Copies a value to the internal Studio clipboard. [Syntax](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#syntax) ---------------------------------------------------------------------------- setrbxclipboard(value: any) -> () [Parameters](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#parameters) ------------------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `value` | `any` | Value to convert with Luau's `tostring` and copy | [Returns](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#returns) ------------------------------------------------------------------------------ This function does not return a value. [Example](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#example) ------------------------------------------------------------------------------ setrbxclipboard("Text for the Studio clipboard") [Notes](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#notes) -------------------------------------------------------------------------- * This is distinct from the operating-system clipboard used by `setclipboard` * Non-string values use the same `tostring` conversion as `setclipboard` [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#related-functions) -------------------------------------------------------------------------------------------------- * [`setclipboard`](https://docs.voltbz.net/docs/miscellaneous/setclipboard) - Copy to the operating-system clipboard [setfpscap\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/setfpscap) [Drawing\ \ Next Page](https://docs.voltbz.net/docs/drawing) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#syntax) [Parameters](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#parameters) [Returns](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#returns) [Example](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#example) [Notes](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#notes) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setrbxclipboard#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) clearqueueonteleport ==================== Clears the teleport script queue. [Syntax](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#syntax) --------------------------------------------------------------------------------- clearqueueonteleport() -> () [Aliases](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#aliases) ----------------------------------------------------------------------------------- * `clearteleportqueue` * `clear_teleport_queue` [Returns](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#returns) ----------------------------------------------------------------------------------- This function does not return a value. [Description](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#description) ------------------------------------------------------------------------------------------- `clearqueueonteleport` removes any script that was queued to run after teleporting. [Example](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#example) ----------------------------------------------------------------------------------- -- Queue a script queueonteleport("print('Hello after teleport')") -- Change our mind clearqueueonteleport() -- Now nothing will run after teleporting [Related Functions](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#related-functions) ------------------------------------------------------------------------------------------------------- * [`queueonteleport`](https://docs.voltbz.net/docs/miscellaneous/queueonteleport) - Queue a teleport script [Miscellaneous\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous) [get\_process\_identifier\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/get_process_identifier) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#syntax) [Aliases](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#aliases) [Returns](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#description) [Example](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#example) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/clearqueueonteleport#related-functions) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) getfpscap ========= Gets the current FPS cap. [Syntax](https://docs.voltbz.net/docs/miscellaneous/getfpscap#syntax) ---------------------------------------------------------------------- getfpscap() -> number [Returns](https://docs.voltbz.net/docs/miscellaneous/getfpscap#returns) ------------------------------------------------------------------------ | Type | Description | | --- | --- | | `number` | Current FPS cap | [Description](https://docs.voltbz.net/docs/miscellaneous/getfpscap#description) -------------------------------------------------------------------------------- `getfpscap` returns the current maximum FPS setting. [Example](https://docs.voltbz.net/docs/miscellaneous/getfpscap#example) ------------------------------------------------------------------------ local currentCap = getfpscap() print("Current FPS cap:", currentCap) if currentCap == 0 then setfpscap(60) else setfpscap(0) end [Related Functions](https://docs.voltbz.net/docs/miscellaneous/getfpscap#related-functions) -------------------------------------------------------------------------------------------- * [`setfpscap`](https://docs.voltbz.net/docs/miscellaneous/setfpscap) - Set FPS cap [getfflag\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/getfflag) [gethwid\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/gethwid) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/getfpscap#syntax) [Returns](https://docs.voltbz.net/docs/miscellaneous/getfpscap#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/getfpscap#description) [Example](https://docs.voltbz.net/docs/miscellaneous/getfpscap#example) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/getfpscap#related-functions) --- # Volt Documentation [Encoding](https://docs.voltbz.net/docs/encoding) lz4decompress ============= Decompresses LZ4 compressed data. [Syntax](https://docs.voltbz.net/docs/encoding/lz4decompress#syntax) --------------------------------------------------------------------- lz4decompress(data: string, size: number) -> string Also available as `crypt.lz4decompress`. [Parameters](https://docs.voltbz.net/docs/encoding/lz4decompress#parameters) ----------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `data` | `string` | The LZ4 compressed data | | `size` | `number` | Maximum size of the decompressed output | [Returns](https://docs.voltbz.net/docs/encoding/lz4decompress#returns) ----------------------------------------------------------------------- | Type | Description | | --- | --- | | `string` | The decompressed data | [Description](https://docs.voltbz.net/docs/encoding/lz4decompress#description) ------------------------------------------------------------------------------- `lz4decompress` restores data produced by `lz4compress`. The supplied size must be large enough for the original data. [Example](https://docs.voltbz.net/docs/encoding/lz4decompress#example) ----------------------------------------------------------------------- local original = "This is the original data that will be compressed!" local compressed = lz4compress(original) local decompressed = lz4decompress(compressed, #original) print(original == decompressed) -- true If `size` is too small, decompression fails. When persisting compressed data, store the original byte length alongside it. [Related Functions](https://docs.voltbz.net/docs/encoding/lz4decompress#related-functions) ------------------------------------------------------------------------------------------- * [`lz4compress`](https://docs.voltbz.net/docs/encoding/lz4compress) - Compress with LZ4 [lz4compress\ \ Previous Page](https://docs.voltbz.net/docs/encoding/lz4compress) [Miscellaneous\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous) ### On this page [Syntax](https://docs.voltbz.net/docs/encoding/lz4decompress#syntax) [Parameters](https://docs.voltbz.net/docs/encoding/lz4decompress#parameters) [Returns](https://docs.voltbz.net/docs/encoding/lz4decompress#returns) [Description](https://docs.voltbz.net/docs/encoding/lz4decompress#description) [Example](https://docs.voltbz.net/docs/encoding/lz4decompress#example) [Related Functions](https://docs.voltbz.net/docs/encoding/lz4decompress#related-functions) --- # Volt Documentation [Metatable](https://docs.voltbz.net/docs/metatable) setreadonly =========== Sets a table's read-only status. [Syntax](https://docs.voltbz.net/docs/metatable/setreadonly#syntax) -------------------------------------------------------------------- setreadonly(table: table, readonly: boolean) -> () [Parameters](https://docs.voltbz.net/docs/metatable/setreadonly#parameters) ---------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `table` | `table` | The table to modify | | `readonly` | `boolean` | The new read-only status | [Returns](https://docs.voltbz.net/docs/metatable/setreadonly#returns) ---------------------------------------------------------------------- This function does not return a value. [Description](https://docs.voltbz.net/docs/metatable/setreadonly#description) ------------------------------------------------------------------------------ `setreadonly` controls whether a table can be modified. This is useful for modifying game metatables, which are locked by default. [Example](https://docs.voltbz.net/docs/metatable/setreadonly#example) ---------------------------------------------------------------------- local mt = getrawmetatable(game) -- Unlock the metatable setreadonly(mt, false) -- Now we can modify it local oldIndex = mt.__index mt.__index = newcclosure(function(self, key) print("Accessing:", key) return oldIndex(self, key) end) -- Re-lock for safety setreadonly(mt, true) [Pattern for Safe Modification](https://docs.voltbz.net/docs/metatable/setreadonly#pattern-for-safe-modification) ------------------------------------------------------------------------------------------------------------------ local function safeModifyMetatable(object, modifier) local mt = getrawmetatable(object) local wasReadonly = isreadonly(mt) if wasReadonly then setreadonly(mt, false) end modifier(mt) if wasReadonly then setreadonly(mt, true) end end safeModifyMetatable(game, function(mt) -- Your modifications here end) [Notes](https://docs.voltbz.net/docs/metatable/setreadonly#notes) ------------------------------------------------------------------ * Always re-lock metatables after modification * Some anti-cheats check for unlocked metatables * Works on any Luau table, not just metatables [Related Functions](https://docs.voltbz.net/docs/metatable/setreadonly#related-functions) ------------------------------------------------------------------------------------------ * [`isreadonly`](https://docs.voltbz.net/docs/metatable/isreadonly) - Check read-only status * [`getrawmetatable`](https://docs.voltbz.net/docs/metatable/getrawmetatable) - Get the metatable [setrawmetatable\ \ Previous Page](https://docs.voltbz.net/docs/metatable/setrawmetatable) [Environment\ \ Next Page](https://docs.voltbz.net/docs/environment) ### On this page [Syntax](https://docs.voltbz.net/docs/metatable/setreadonly#syntax) [Parameters](https://docs.voltbz.net/docs/metatable/setreadonly#parameters) [Returns](https://docs.voltbz.net/docs/metatable/setreadonly#returns) [Description](https://docs.voltbz.net/docs/metatable/setreadonly#description) [Example](https://docs.voltbz.net/docs/metatable/setreadonly#example) [Pattern for Safe Modification](https://docs.voltbz.net/docs/metatable/setreadonly#pattern-for-safe-modification) [Notes](https://docs.voltbz.net/docs/metatable/setreadonly#notes) [Related Functions](https://docs.voltbz.net/docs/metatable/setreadonly#related-functions) --- # Volt Documentation [Scripts](https://docs.voltbz.net/docs/scripts) decompile ========= Decompiles Luau bytecode into source text. [Syntax](https://docs.voltbz.net/docs/scripts/decompile#syntax) ---------------------------------------------------------------- decompile(source: LuaSourceContainer | string, options: DecompilerOptions?) -> string DecompilerOptions.new() -> DecompilerOptions DecompilerFormatter.new() -> DecompilerFormatter [Parameters](https://docs.voltbz.net/docs/scripts/decompile#parameters) ------------------------------------------------------------------------ | Parameter | Type | Description | | --- | --- | --- | | `source` | `LuaSourceContainer \| string` | A client-visible script or raw Luau bytecode | | `options` | `DecompilerOptions?` | Optional decompiler settings | [Description](https://docs.voltbz.net/docs/scripts/decompile#description) -------------------------------------------------------------------------- Pass a script to decompile it directly, or pass a Luau bytecode string. Server-running `Script` instances are not supported. The function yields until decompilation finishes and raises an error if the input cannot be decompiled. [DecompilerOptions](https://docs.voltbz.net/docs/scripts/decompile#decompileroptions) -------------------------------------------------------------------------------------- `DecompilerOptions.new()` initializes its fields from Volt's current decompiler settings. | Property | Type | Description | | --- | --- | --- | | `SmartVariableRenamer` | `boolean` | Improve generated local-variable names | | `FunctionDeclarations` | `boolean` | Recover declaration-style functions when possible | | `GuardClauses` | `boolean` | Recover guard-clause control flow | | `ConstantFolding` | `boolean` | Fold eligible constant expressions | | `ConditionalStructurer` | `boolean` | Reconstruct conditional control flow | | `DoBlockInsertionThreshold` | `number` | Threshold used when inserting `do` blocks | | `Formatter` | `DecompilerFormatter` | Formatter configuration | [DecompilerFormatter](https://docs.voltbz.net/docs/scripts/decompile#decompilerformatter) ------------------------------------------------------------------------------------------ `DecompilerFormatter.new()` also uses the current Volt settings as its defaults. | Property | Type | Description | | --- | --- | --- | | `IndentWidth` | `number` | Spaces used for each indentation level | | `ColumnLimit` | `number` | Preferred output column limit | | `ParenthesizeConditions` | `boolean` | Add parentheses around conditions | | `AppendSemicolons` | `boolean` | Append semicolons to statements | | `FunctionMetadataEnabled` | `boolean` | Emit function metadata | | `FunctionMetadataLayout` | `number` | Metadata layout constant | | `FunctionMetadataIncludeName` | `boolean` | Include function names in metadata | | `FunctionMetadataIncludeLine` | `boolean` | Include source lines in metadata | | `FunctionMetadataIncludeUpvalues` | `boolean` | Include upvalue information | | `FunctionMetadataUpvalueFormat` | `number` | Upvalue-format constant | ### [Metadata Constants](https://docs.voltbz.net/docs/scripts/decompile#metadata-constants) DecompilerFormatter.FunctionMetadata.Layout.Block DecompilerFormatter.FunctionMetadata.Layout.Inline DecompilerFormatter.FunctionMetadata.UpvalueFormat.Name DecompilerFormatter.FunctionMetadata.UpvalueFormat.Kind DecompilerFormatter.FunctionMetadata.UpvalueFormat.KindAndIndex [Example](https://docs.voltbz.net/docs/scripts/decompile#example) ------------------------------------------------------------------ local module = getloadedmodules()[1] assert(module, "No loaded ModuleScript was available") local options = DecompilerOptions.new() options.SmartVariableRenamer = true options.GuardClauses = true options.Formatter.IndentWidth = 4 options.Formatter.ColumnLimit = 100 options.Formatter.FunctionMetadataEnabled = true options.Formatter.FunctionMetadataLayout = DecompilerFormatter.FunctionMetadata.Layout.Block local success, sourceOrError = pcall(decompile, module, options) if success then print(sourceOrError) else warn("Decompilation failed:", sourceOrError) end [Raw Bytecode](https://docs.voltbz.net/docs/scripts/decompile#raw-bytecode) ---------------------------------------------------------------------------- local module = assert(getloadedmodules()[1]) local bytecode = getscriptbytecode(module) local source = decompile(bytecode) print(source) [Related Functions](https://docs.voltbz.net/docs/scripts/decompile#related-functions) -------------------------------------------------------------------------------------- * [`getscriptbytecode`](https://docs.voltbz.net/docs/scripts/getscriptbytecode) - Retrieve script bytecode * [`getscripthash`](https://docs.voltbz.net/docs/scripts/getscripthash) - Hash script bytecode [Related Guides](https://docs.voltbz.net/docs/scripts/decompile#related-guides) -------------------------------------------------------------------------------- * [Decompiler](https://docs.voltbz.net/docs/decompiler) - Pipeline overview [Scripts\ \ Previous Page](https://docs.voltbz.net/docs/scripts) [getcallingscript\ \ Next Page](https://docs.voltbz.net/docs/scripts/getcallingscript) ### On this page [Syntax](https://docs.voltbz.net/docs/scripts/decompile#syntax) [Parameters](https://docs.voltbz.net/docs/scripts/decompile#parameters) [Description](https://docs.voltbz.net/docs/scripts/decompile#description) [DecompilerOptions](https://docs.voltbz.net/docs/scripts/decompile#decompileroptions) [DecompilerFormatter](https://docs.voltbz.net/docs/scripts/decompile#decompilerformatter) [Metadata Constants](https://docs.voltbz.net/docs/scripts/decompile#metadata-constants) [Example](https://docs.voltbz.net/docs/scripts/decompile#example) [Raw Bytecode](https://docs.voltbz.net/docs/scripts/decompile#raw-bytecode) [Related Functions](https://docs.voltbz.net/docs/scripts/decompile#related-functions) [Related Guides](https://docs.voltbz.net/docs/scripts/decompile#related-guides) --- # Volt Documentation [Miscellaneous](https://docs.voltbz.net/docs/miscellaneous) setclipboard ============ Copies a value's string representation to the system clipboard. [Syntax](https://docs.voltbz.net/docs/miscellaneous/setclipboard#syntax) ------------------------------------------------------------------------- setclipboard(data: any) -> () [Aliases](https://docs.voltbz.net/docs/miscellaneous/setclipboard#aliases) --------------------------------------------------------------------------- * `toclipboard` [Parameters](https://docs.voltbz.net/docs/miscellaneous/setclipboard#parameters) --------------------------------------------------------------------------------- | Parameter | Type | Description | | --- | --- | --- | | `data` | `any` | The value to convert to a string and copy | [Returns](https://docs.voltbz.net/docs/miscellaneous/setclipboard#returns) --------------------------------------------------------------------------- This function does not return a value. [Description](https://docs.voltbz.net/docs/miscellaneous/setclipboard#description) ----------------------------------------------------------------------------------- `setclipboard` calls `tostring` on the value and copies the result. [Example](https://docs.voltbz.net/docs/miscellaneous/setclipboard#example) --------------------------------------------------------------------------- -- Copy a simple message setclipboard("Hello, World!") -- Copy player information local player = game.Players.LocalPlayer setclipboard(player.Name .. " - " .. player.UserId) -- Copy a table as JSON local HttpService = game:GetService("HttpService") local data = {name = "Player", score = 100} setclipboard(HttpService:JSONEncode(data)) [Notes](https://docs.voltbz.net/docs/miscellaneous/setclipboard#notes) ----------------------------------------------------------------------- * Tables are not automatically JSON-encoded; encode structured data explicitly when needed [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setclipboard#related-functions) ----------------------------------------------------------------------------------------------- * [`identifyexecutor`](https://docs.voltbz.net/docs/miscellaneous/identifyexecutor) - Get executor info [saveplace\ \ Previous Page](https://docs.voltbz.net/docs/miscellaneous/saveplace) [setfflag\ \ Next Page](https://docs.voltbz.net/docs/miscellaneous/setfflag) ### On this page [Syntax](https://docs.voltbz.net/docs/miscellaneous/setclipboard#syntax) [Aliases](https://docs.voltbz.net/docs/miscellaneous/setclipboard#aliases) [Parameters](https://docs.voltbz.net/docs/miscellaneous/setclipboard#parameters) [Returns](https://docs.voltbz.net/docs/miscellaneous/setclipboard#returns) [Description](https://docs.voltbz.net/docs/miscellaneous/setclipboard#description) [Example](https://docs.voltbz.net/docs/miscellaneous/setclipboard#example) [Notes](https://docs.voltbz.net/docs/miscellaneous/setclipboard#notes) [Related Functions](https://docs.voltbz.net/docs/miscellaneous/setclipboard#related-functions) ---