-- Determine if a function belongs to a game scriptlocal function check_closure(func) local s = getscriptfromclosure(func) if s then print("Function defined in: " .. s.Name) else print("Native or untracked function") endend
Handy when hooking functions to identify which game script is invoking specific handlers.