Skip to main content
Runs your function on every outgoing packet, just before it leaves the client.
RakNet is how Roblox connects you to the server over the internet.
Pretty much the same thing as RemoteEvent’s and RemoteFunction’s - they do the same job, but in RakNet you work with the raw packets instead of simple remotes.
Your hook receives one RakNetMessage for the packet. From inside the hook you can read its payload, replace it with RakNetMessage:SetData, or stop the packet with RakNetMessage:Block. The hook runs on outgoing packets only. Several hooks can be registered at once and every one of them runs per packet.

Parameters

Returns

void raknet.add_send_hook returns nothing. Your hook decides the packet’s fate by its return value:
  • return false - the packet is dropped and never sent.
  • return nil, or nothing - the packet passes through unchanged.

Example

Log every outgoing packet’s metadata.
You need to enable this feature in the UI settings for hooks to run. Using this can lead to account bans.