addTextChatMessage
addTextChatMessage(
step,addTextChatMessageOptions):void
Writes a message into text chat from an authoritative system: a system
message from the game, such as “The gates open in 10 seconds.”, or an
NPC’s line with from. The room filters it and delivers it after the
step, to to or to every player the channel reaches. In a game played
alone the player’s page shows it. Throws for a text longer than
textChatMessageLength and for from a player. As Roblox’s
DisplaySystemMessage. Authoritative systems only: a predicted system
re-runs, so its step is refused.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
step |
AuthoritativeStep & UnpredictedStep |
addTextChatMessageOptions |
AddTextChatMessageOptions |
Returns
Section titled “Returns”void
Example
Section titled “Example”addTextChatMessage(step, { text: "The gates open in 10 seconds." });addTextChatMessage(step, { to: [player], text: ["You found ", item, "."] });addTextChatMessage(step, { from: shopkeeper, text: "Fresh bread!" });