Packet:Block
Discards the current intercepted packet.
Syntax
Signature
Packet:Block() -> ()Aliases
This function has no aliases.
Parameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
() | No return values. |
Notes
It cannot be used on standalone packets, history entries, or incoming observer packets.
Example
Luau
-- Suppress outgoing chat packets for five seconds.
local Hook = network.add_send_hook(function(Packet)
if Packet.type == "Chat" then
Packet:Block()
print("Discarded an outgoing chat packet")
end
end)
task.delay(5, function()
network.remove_send_hook(Hook)
print("Chat packets are no longer suppressed")
end)