network.remove_send_hook

Removes an outgoing packet hook.

Syntax

Signature
network.remove_send_hook(Hook: number | function) -> boolean

Aliases

  • raknet.remove_send_hook
  • packets.remove_send_hook
  • RakNet.remove_send_hook
  • network.removesendhook
  • raknet.removesendhook
  • packets.removesendhook
  • RakNet.removesendhook

Parameters

ParameterTypeDescription
Hooknumber | functionID returned by registration, or the registered callback.

Returns

TypeDescription
booleanWhether at least one hook was removed.

Notes

Removes outgoing 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_send_hook(function(Packet)
    print(Packet.type)
end)
print(network.remove_send_hook(Hook))