raknet.remove_send_hook Synchronous

  • RakNet.remove_send_hook
  • RakNet.removesendhook
  • raknet.removesendhook

Unregister a callback previously added with raknet.add_send_hook. Keep the exact function reference you registered so cleanup can remove it later.

Syntax
Luau
raknet.remove_send_hook(callback: Function) -> ()

Parameters

Function parameters
ParameterTypeDescription
callbackFunctionThe registered callback function.

Returns

()

No value.

Usage notes

This removes matching legacy send-hook registrations. Signal connections use :Disconnect instead.

Availability

RakNet is disabled by default. RakNet and raknet are removed when the setting is off; retained references can still call is_enabled().

Example

Example
Luau
if raknet.is_enabled() then
    local function onSend(packet) print(packet.ID) end
    raknet.add_send_hook(onSend)
    raknet.remove_send_hook(onSend)
end
Kawaii documentation