chat Module

The chat module provides APIs for sending chat messages to players.

Chat Message Functions

SendSystemMessage(playerEntityId, message)

Definition

chat.SendSystemMessage(playerEntityId, message)

Sends a system message to a specific player. System messages are informational text intended to communicate the result of a chat command or similar (e.g. the response to the /help command).

Parameters:
  • playerEntityId (integer) – Entity ID of the target player.

  • message (string) – Message.

Example

Sending a system chat message to a player using chat.SendSystemMessage.
chat.SendSystemMessage(playerEntityId, "This is a system message.")

SendToPlayer(playerEntityId, color, message)

Definition

chat.SendToPlayer(playerEntityId, color, message)

Sends a generic chat message to a specific player.

Parameters:
  • playerEntityId (integer) – Entity ID of the target player.

  • color (integer) – RGB text color.

  • message (string) – Message.

Example

Sending a chat message to a player using chat.SendToPlayer.
chat.SendToPlayer(playerEntityId, color.Rgb(210, 210, 0),
    "This is a message sent with SendToPlayer.")

SendToAll(color, message)

Definition

chat.SendToAll(color, message)

Sends a generic chat message to all players.

Parameters:
  • color (integer) – RGB text color.

  • message (string) – Message.

Example

Sending a chat message to all players using chat.SendToAll.
chat.SendToAll(color.Rgb(210, 210, 0), "This is a message sent with SendToAll.")