PlayerChatted
This member cannot be used in scripts, but is usable in the command bar.
For thread safety, this property is not safe to read in an unsynchronized thread.
The PlayerChatted Players event fires when a player chats.
The value of the Enum/PlayerChatType determines the type of chat sent. There are three types of chat:
| Type | Description |
|---|---|
| All | A global message that everyone can receive. |
| Team | A team message only players in the same team can receive. |
| Whisper | A whispered message only the person it’s whispered to can receive. If the chat type is a Whisper Chat, the targetPlayer is the player being whispered to. |
Note that this event is not intended for wide use and will not work in Scripts or LocalScripts.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
The type of chat. Either all, team, or whisper. |
||
|
|
The player chatting (sending the message). |
||
|
|
The message being chatted. |
||
|
|
The player receiving the message if the chat is a whisper. |
Code Samples
Checking Player Chatted in Command Bar
This example demonstrates that the Players/PlayerChatted event fires when a player chats in the game by printing the player and the message chatted using the PlayerChatted parameters.
This example will function as expected when executed in the command bar.