setstackhidden
Sets whether a function is hidden from stack traces.
Syntax
setstackhidden(func: function, hidden: boolean) -> voidParameters
| Parameter | Type | Description |
|---|---|---|
func | function | The function to modify |
hidden | boolean | Whether to hide from stack |
Returns
This function does not return a value.
Description
setstackhidden controls whether a function appears in stack traces and debug info. Hidden functions are invisible to stack inspection.
Example
local function secretFunc()
print("This function is hidden!")
end
setstackhidden(secretFunc, true)
-- Now secretFunc won't appear in debug.traceback()Use Cases
- Hiding hook implementations
- Preventing detection via stack inspection
- Clean stack traces
Related Functions
debug.getinfo- Get function infodebug.getcallstack- Get call stack