Volt

Closures

The Closures library allows for viewing info about a closures origin and allowing the manipulation of said closure.

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

FunctionDescription
checkcallerCheck if the current call is from volt
clonefunctionCreate a copy of a function
getfunctionhashGet the hash of a function's bytecode
hookfunctionReplace a function with another
hookmetamethodHook a metatable metamethod
iscclosureCheck if a function is a C closure
isexecutorclosureCheck if a function is from volt
isfunctionhookedCheck if a function has been hooked
islclosureCheck if a function is a Luau closure
isnewcclosureCheck if a function is a newcclosure
newcclosureWrap a Luau function as a C closure
newlclosureWrap a C closure as a Luau closure
restorefunctionRestore a hooked function to its original
setstackhiddenHide a function from stack traces

Closure Types

There are two main types of closures:

C Closures

Functions implemented in C/C++. These are typically:

  • Built-in Lua functions like print, type
  • Roblox API methods
  • Majority of custom functions

Luau Closures

Functions written in Luau. These are typically:

  • User-defined functions
  • Game Script functions

On this page