raknet.remove_receive_hook Synchronous

  • RakNet.remove_receive_hook
  • RakNet.removereceivehook
  • raknet.removereceivehook

Unregister a callback previously added with raknet.add_receive_hook. Use this when an inspection window or packet modification is finished.

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

Parameters

Function parameters
ParameterTypeDescription
callbackFunctionThe exact callback function that was registered.

Returns

()

No value.

Usage notes

Signal connections created with OnPacketReceive:Connect 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 onReceive(packet) print(packet.ID) end
    raknet.add_receive_hook(onReceive)
    raknet.remove_receive_hook(onReceive)
end
Kawaii documentation