network.remove_receive_hook
Removes an incoming packet observer.
Syntax
Signature
network.remove_receive_hook(Hook: number | function) -> booleanAliases
raknet.remove_receive_hookpackets.remove_receive_hookRakNet.remove_receive_hooknetwork.removereceivehookraknet.removereceivehookpackets.removereceivehookRakNet.removereceivehook
Parameters
| Parameter | Type | Description |
|---|---|---|
Hook | number | function | ID returned by registration, or the registered callback. |
Returns
| Type | Description |
|---|---|
boolean | Whether at least one hook was removed. |
Notes
Removes incoming hooks matching a hook ID or the exact callback function. Passing a callback removes every matching hook in that direction.
Example
Luau
local Hook = network.add_receive_hook(function(Packet)
print(Packet.type)
end)
print(network.remove_receive_hook(Hook))