This modified version of Packet offers simplified packet definitions and packet safety (early packets are still received). Additionally, it brings minor improvements regarding error messages and optimization.
First and foremost, learn the original Packet library.
Then, for Packet+, you need to setup a signal library.
Signal+ is recommended because it’s the best.
Make sure to tag the module Signal.
The API is mostly identical to the original library, but there is a key difference, seen below:
Use a shared module:
local Packet = require(path.to.Packet)
return {
MyPacket = Packet("MyPacket", Packet.String),
MyCoolPacket = Packet("MyCoolPacket", Packet.Number)
}Or put definitions in every script that uses the packets:
local Packet = require(path.to.Packet)
local myPacket = Packet("MyPacket", Packet.String)
local myCoolPacket = Packet("MyCoolPacket", Packet.Number)Use a shared module:
local Packet = require(path.to.Packet)
return {
MyPacket = Packet(Packet.String),
MyCoolPacket = Packet(Packet.Number)
}Packet+ removes the name parameter, requiring packets to be defined in a shared module. The packet name is inferred from the table key, reducing repetition and keeping definitions centralized and efficient.