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
| Function | Description |
|---|---|
checkcaller | Check if the current call is from volt |
clonefunction | Create a copy of a function |
getfunctionhash | Get the hash of a function's bytecode |
hookfunction | Replace a function with another |
hookmetamethod | Hook a metatable metamethod |
iscclosure | Check if a function is a C closure |
isexecutorclosure | Check if a function is from volt |
isfunctionhooked | Check if a function has been hooked |
islclosure | Check if a function is a Luau closure |
isnewcclosure | Check if a function is a newcclosure |
newcclosure | Wrap a Luau function as a C closure |
newlclosure | Wrap a C closure as a Luau closure |
restorefunction | Restore a hooked function to its original |
setstackhidden | Hide 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