Is there a way to get the functions being called inside of a function?

  1. What do you want to achieve? I want to get the functions inside of a function, to then get the arguments inside of that function.

  2. What is the issue? When I try getconstants, it returns a string which I cannot turn into the original function.

  3. What solutions have you tried so far? I’ve searched the debug functions which I bet is my chance, but couldn’t find anything.

For Example:

function foo()

function bar(func)
    -- "functions" is the functions inside of the function
    return functions

for i, v in pairs(bar(foo)) do
    print(i, v) 


1 function: 0x1278172912
2 function: 0x1279127319
3 function: 0x1236718267

I don’t think this is possible but I’ve seen someone do it so yeah.

You can’t with running code inside the script, nbut you can get the functions used using debug.traceback() inside the functions inside another function.

You could however, read the string source to figure out what functions are inside another.