getfenv, debug.info, debug.traceback
and related level-based inspection, so code probing the stack sees the game’s
frames rather than yours.
Parameters
function | number
required
The function to hide, or a stack level resolving to a function currently on
the stack. Level
0 is the calling function, 1 its caller, and so on.true to hide the function’s frames, false to stop hiding them.Behavior
- Hiding is per-function and persistent until you set it back to
false. - When any function is hidden, the environment’s stack-level accounting
transparently skips hidden frames, so a script calling
getfenv(2)ordebug.info(2, ...)counts visible frames only. - Passing a level resolves the function at that level once, at call time, and hides that function.
Example
Hide the current function’s frames from anything that inspects the stack:Errors
Related
checkcaller: identify your own calls.isexecutorclosure: identify your own functions.