add_receive_hook. Pass the same function you
added.
Parameters
function
required
The exact function that was added.
Behavior
- Identity matters, as with the send hooks: keep a reference to the function you added.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Remove a receive hook.
raknet.remove_receive_hook(callback: function) -> ()
add_receive_hook. Pass the same function you
added.
getgenv() rather than as a plain global. Guard your
code with if getgenv().raknet then ... end, or read
raknet.is_enabled.local function onRecv(packet) end
raknet.add_receive_hook(onRecv)
raknet.remove_receive_hook(onRecv)
| Message | Condition |
|---|---|
argument 1 must be the function that was added | callback was not a function. |