Skip to content

Packet Function

This page covers the API Reference for the ‘PacketFunction’ instance.

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.

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.