OutputChatBox
Jump to navigation
Jump to search
outputChatBox
Sends a chat message to all players, one player, or a table of player identifiers.
Syntax
bool outputChatBox(string message [, mixed visibleTo = root [, int red = 231 [, int green = 217 [, int blue = 176 [, bool colorCoded = false]]]]])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
message |
string |
yes | The message to send. |
visibleTo |
int|table | no | Broadcast target: root/nil, one player id, or a table of player ids. |
red |
int |
no | Red color channel from 0 to 255. |
green |
int |
no | Green color channel from 0 to 255. |
blue |
int |
no | Blue color channel from 0 to 255. |
colorCoded |
bool |
no | Whether inline color codes should be interpreted. |
Returns
Returns true when the message is accepted for delivery; otherwise returns false.
Examples
Send a green message to nearby players:
local recipients = getPlayersInRange(playerId, 25, true)
outputChatBox("[Local] " .. message, recipients, 160, 220, 160, false)
Notes
- Available only in server-side resource scripts.