> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# raknet.remove_send_hook

Stops a hook you added with `raknet.add_send_hook` from running.

```luau theme={null}
raknet.remove_send_hook(hook: function): ()
```

RakNet is the connection Roblox uses to talk to the server over the internet. <br />It does the same job as `RemoteEvent` and `RemoteFunction`, just with raw packets rather than ready-made remotes.

Pass the exact same function you gave `raknet.add_send_hook`. That hook stops running on outgoing packets. Any other registered hooks keep running.

## Parameters

| Parameter | Type       | Description         |
| --------- | ---------- | ------------------- |
| `hook`    | `function` | The hook to remove. |

## Returns

<code title="the function does not return a value.">void</code>

## Example

Run a send hook, then detach it with the same stored reference.

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  raknet.remove_send_hook()
  =======
  -- raknet.remove_send_hook(hook: function): ()
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local function onSend(packet)
      -- inspect or edit outgoing packets here
  end

  raknet.add_send_hook(onSend)

  task.delay(5, function()
      raknet.remove_send_hook(onSend)
  end)
  ```
</CodeGroup>

<Tip>
  Always clean up hooks when script unloads to prevent performance degradation.
</Tip>
