API:Class/Chat

Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.
Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.
Uncreatable: This object cannot be created with Instance.new.

Message icon.pngChat : Object Icon.pngInstance

The Chat service is a special service that houses all of the Lua code responsible for running Roblox's in-game chat. Similarly to the ExplorerImageIndex78.pngStarterPlayerScripts, there are default objects that are inserted into the Chat service, that can be overridden with your own scripts.

The following objects are guaranteed to exist inside of the Chat service, and can be overridden by your own objects:

  • Tree-collapse.png
    Chat
    Chat
    • Expand.png
      Script
      ChatServiceRunner
    • LocalScript
      BubbleChat
    • Expand.png
      LocalScript
      ChatScript
    • Expand.png
      Folder
      ChatModules
    • Tree-collapse.png
      Folder
      ClientChatModules
      • ModuleScript
        ChatConstants
      • ModuleScript
        ChatSettings
      • Expand.png
        Folder
        CommandModules
      • Expand.png
        Folder
        MessageCreatorModules


The default chat system is designed to be a modular framework, so it should be easy to just modify the existing chat system to your needs, instead of writing a new one.
Check out this article to learn more about how the chat system works.

Properties

Properties [toggle]

boolLoadDefaultChat [NotAccessibleSecurity]

Toggles whether the default chat framework should be automatically loaded when the game runs.

|RMD member="API:Class/Chat/LoadDefaultChat"|Toggles whether the default chat framework should be automatically loaded when the game runs.|/RMD|
LoadDefaultChat [NotAccessibleSecurity]
Toggles whether the default chat framework should be automatically loaded when the game runs.

Functions

Functions [toggle]

voidChat ( PVInstance partOrCharacter, string message, ChatColor color = Blue )

Fires the Chatted event with the parameters specified in this method. By default, there is a LocalScript inside of each player's PlayerScripts object named BubbleChat, which causes a dialog-like billboard to appear above the partOrCharacter when the chatted event is fired.

|RMD member="API:Class/Chat/Chat"|Fires the Chatted event with the parameters specified in this method.

By default, there is a LocalScript inside of each player's PlayerScripts object named BubbleChat, which causes a dialog-like billboard to appear above the partOrCharacter when the chatted event is fired.|/RMD|

Chat ( PVInstance partOrCharacter, string message, ChatColor color = Blue )
Fires the Chatted event with the parameters specified in this method. By default, there is a LocalScript inside of each player's PlayerScripts object named BubbleChat, which causes a dialog-like billboard to appear above the partOrCharacter when the chatted event is fired.

YieldFunctions

YieldFunctionsmemberhiddenYieldFunctions [toggle]

boolCanUserChatAsync ( int userId )

Will return false if the player with the specified UserId is not allowed to chat because of their account settings.

|RMD member="API:Class/Chat/CanUserChatAsync"|Will return false if the player with the specified UserId is not allowed to chat because of their account settings.|/RMD|
boolCanUsersChatAsync ( int userIdFrom, int userIdTo )

Will return false if the two users cannot communicate because their account settings do not allow it.

|RMD member="API:Class/Chat/CanUsersChatAsync"|Will return false if the two users cannot communicate because their account settings do not allow it.|/RMD|
stringFilterStringAsync ( string stringToFilter, Player playerFrom, Player playerTo )

Filters a string being sent to playerTo from playerFrom with filtering that is appropriate to the given player's account settings.

|RMD member="API:Class/Chat/FilterStringAsync"|Filters a string being sent to playerTo from playerFrom with filtering that is appropriate to the given player's account settings.|/RMD|
stringFilterStringForBroadcast ( string stringToFilter, Player playerFrom )

Filters a string sent from a player meant for broadcast to no particular target. More restrictions than FilterStringAsync.

|RMD member="API:Class/Chat/FilterStringForBroadcast"|Filters a string sent from a player meant for broadcast to no particular target. More restrictions than FilterStringAsync.|/RMD|
stringFilterStringForPlayerAsync ( string stringToFilter, Instance playerToFilterFor ) [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/Chat/FilterStringForPlayerAsync"|Deprecated. Do not use.|/RMD|
Will return false if the player with the specified UserId is not allowed to chat because of their account settings.
CanUsersChatAsync ( int userIdFrom, int userIdTo )
Will return false if the two users cannot communicate because their account settings do not allow it.
FilterStringAsync ( string stringToFilter, Player playerFrom, Player playerTo )
Filters a string being sent to playerTo from playerFrom with filtering that is appropriate to the given player's account settings.
FilterStringForBroadcast ( string stringToFilter, Player playerFrom )
Filters a string sent from a player meant for broadcast to no particular target. More restrictions than FilterStringAsync.
FilterStringForPlayerAsync ( string stringToFilter, Instance playerToFilterFor ) [deprecated]
Deprecated. Do not use.

Events

Events [toggle]

Chatted ( PVInstance part, string message, ChatColor color )

Fires when Chat is called.

|RMD member="API:Class/Chat/Chatted"|Fires when Chat is called.|/RMD|
Chatted ( PVInstance part, string message, ChatColor color )
Fires when Chat is called.
|RMD member="API:Class/Chat"|The Chat service is a special service that houses all of the Lua code responsible for running Roblox's in-game chat. Similarly to the ExplorerImageIndex78.pngStarterPlayerScripts, there are default objects that are inserted into the Chat service, that can be overridden with your own scripts. The following objects are guaranteed to exist inside of the Chat service, and can be overridden by your own objects:
  • Tree-collapse.png
    Chat
    Chat
    • Expand.png
      Script
      ChatServiceRunner
    • LocalScript
      BubbleChat
    • Expand.png
      LocalScript
      ChatScript
    • Expand.png
      Folder
      ChatModules
    • Tree-collapse.png
      Folder
      ClientChatModules
      • ModuleScript
        ChatConstants
      • ModuleScript
        ChatSettings
      • Expand.png
        Folder
        CommandModules
      • Expand.png
        Folder
        MessageCreatorModules

The default chat system is designed to be a modular framework, so it should be easy to just modify the existing chat system to your needs, instead of writing a new one.
Check out this article to learn more about how the chat system works. |/RMD|