Skip to content

Understanding Event Direction

Packet Events have a direction based on which side owns the packet in the schema.

The side where the packet is defined is the side that owns and sends the event. The opposite side receives it.

Server-owned events are defined inside the Server section of your schema.

return Packeteer.create({
Server = {
OpenRewardMenu = Packeteer.event<<{
rewardId: number
}>>(),
},
})

The server owns this event, meaning the communication direction is:

Server -> Client

Network.Server.OpenRewardMenu:Fire(player, {
rewardId = 123
})
Network.Server.OpenRewardMenu:Connect(function(data)
print(data.rewardId)
end)

Client-owned events are defined inside the Client section of your schema.

return Packeteer.create({
Client = {
EquipItem = Packeteer.event<<{
itemId: string
}>>(),
},
})

The client owns this event, meaning the communication direction is:

Server -> Client

Network.Client.EquipItem:Fire(nil, {
itemId = "Sword"
})
Network.Client.EquipItem:Connect(function(player, data)
print(player.Name, data.itemId)
end)
Location Sender Receiver
Server Server Client
Client Client Server