Aliases
hookfuncreplaceclosuredetourfunctiondetour_function
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Faz hook de uma target function com uma replacement function e retorna uma cloned copy da original target closure. Ambos arguments devem ser functions. A function primeiro faz flush de pending C function swaps, faz cloning do target por function cloning, adiciona a replacement closure ou seu mapped newcclosure target a hidden stack tracking, chama FixCallstack para target e cloned original, e então aplica patch na target closure pelo C closure, Luau closure ou newcclosure-specific path. Se target ainda não estiver em hook records, o cloned original é armazenado ali para restorefunction. A returned function é a cloned original closure.
hookfunction(target: function, replacement: function): function
hookfuncreplaceclosuredetourfunctiondetour_functionlocal function target(value)
return value + 1
end
local original
original = hookfunction(target, function(value)
return original(value) * 2
end)