NETWORK

Networking functions for client-server communication.

Availability: Client & Server

Methods


NETWORK.broadcast

server

Broadcast a network message to all connected players (server-only)

Signature: bool action(str, obj)

Parameters:

NameTypeDescription
idstrMessage identifier for the network event
dataobjData payload to send (max 2000 characters)

Returns: bool - Whether the broadcast was successful

bool result = GAME.NETWORK.broadcast(0, {});

NETWORK.send

client server

Send a network message to a specific player or to the server

Signature: bool action(str, obj, str)

Parameters:

NameTypeDescription
idstrMessage identifier for the network event
dataobjData payload to send (max 2000 characters)
playerIDstrTarget player ID (required on server, optional on client)

Returns: bool - Whether the send was successful

bool result = GAME.NETWORK.send(0, {}, "value");