ReferenceRakNet

RakNetPacket.PacketId

Reads first packet byte, or zero when the byte is absent. It is not a universal high-level game-event identifier.

Syntax

packet.PacketId: number

Also available as

RakNetPacket.Id

Returns

TypeDescription
numberFirst packet byte, or zero when the byte is absent. It is not a universal high-level game-event identifier.

Description

Packet metadata properties are read-only. Read the value inside the hook, and retain a byte copy when you need data afterward. Direct assignment to a packet property raises an error.

Example

local function inspect(packet)
    local value = packet.PacketId
    print(value)
end
raknet.addsendhook(inspect)
task.delay(5, function() raknet.removesendhook(inspect) end)

These are Game executor contracts. Check build requirements and session lifetimes before using them.