Returns a list of every inner function defined inside a Luau function.
debug.getprotos hands back every proto a Luau function holds at once. Learn more here.
The argument is the parent function, or a number. A number is read as a stack level instead of a direct function, the same way debug.getinfo takes a level. Pair an index from this list with debug.getproto to pull a single nested function out.
Most commonly used to find an inner function the game never stores anywhere you can reference, so you can read it or hook it.
Parameters
Returns
A table that holds every proto function defined inside the target (or inside the closure at the given stack level).
Aliases
Example
This lists all nested child functions defined in the parent function body.