debug.setupvalue
Example
An example demonstrating a function overwrite.
local function my_isfunction(f)
return type(f) == "function" or f == "coolguy"
end
print(debug.setupvalue(hook.Add, 1, my_isfunction))
Sets the variable indexed from func
An example demonstrating a function overwrite.