Packet Function
This page covers the API Reference for the ‘PacketFunction’ instance.
Invokes()
Section titled “Invokes()”Invokes a Packet Function.
Signature
PacketFunction:Invoke(recipient: Player?, parameters: T): Promise<R>Paramaters
- recipient - Player receiving the request.
- parameters - Function arguments
Returns
A Promise resolving to R.
SetCallback()
Section titled “SetCallback()”Assigns the function handler.
Signature
PacketFunction:SetCallback(callback: (Player?, T) -> R): PacketFunction<T, R>Paramaters
- callback - Function executed when invoked
Returns Returns self, allowing chaining.
