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
Section titled “Server-Owned Events”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
Server:
Section titled “Server:”Network.Server.OpenRewardMenu:Fire(player, { rewardId = 123})Client:
Section titled “Client:”Network.Server.OpenRewardMenu:Connect(function(data) print(data.rewardId)end)Client-Owned Events
Section titled “Client-Owned Events”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
Client:
Section titled “Client:”Network.Client.EquipItem:Fire(nil, { itemId = "Sword"})Server:
Section titled “Server:”Network.Client.EquipItem:Connect(function(player, data) print(player.Name, data.itemId)end)Direction Summary:
Section titled “Direction Summary:”| Location | Sender | Receiver |
|---|---|---|
Server |
Server | Client |
Client |
Client | Server |
