Skip to content

EventPayload

EventPayload. You can create an event option like the following code.
1
2
local payload = EventPayload.New({id="abc1234", name="Jerry"})
local content = payload:GetContent()

Functions

EventPayload EventPayload.New(table content)

ReturnsThe new event payload.
Creates a new instance of EventPayload. The only parameter content is the object that needs to be sent. Note: When invoking FireToClient, FireToAllClients and FireToServer, the content of EventPayload must be serializable to JSON, that is content must be one of string, number, boolean, table with string keys and table with successive number keys starting from 1.
  • content The object to sent.

table GetContent()

ReturnsThe object to send.
Get the object to send.