RakNetPacket:Block Synchronous

  • RakNetPacket:Ignore

Veto the current packet before it reaches its destination. Use it with a narrow, verified condition; later observers can still inspect the view but cannot undo the block.

Syntax
Luau
RakNetPacket:Block() -> ()

Parameters

Call this method with a RakNetPacket receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.

This function takes no arguments.

Returns

()

No value.

Usage notes

The RakNet library must be enabled in Environment settings and connected to an active game generation.

The RakNetPacket view is valid only during its callback. Save fields or copy Data inside the callback if you need them later.

The block applies to this packet only. The callback must not yield.

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
local function blockKnownId(packetId)
    return raknet.OnPacketSend:Connect(function(packet)
        if packet.ID == packetId then
            packet:Block()
        end
    end)
end
-- Pass a packet ID you have verified, then disconnect the returned connection.
Kawaii documentation