Tutorial:Editing the Chat

The chat is a powerful tool. It allows players to communicate and play together. At the start of 2017, Roblox unlocked their chat. This allowed developers to edit the chat how ever they wanted. This included adding bots, giving players colored text/chat tags. But how would you edit it? This tutorial explains how! Please note that this is a very hard tutorial and you should have LOTS of scripting knowledge before attempting to do this.

Set Up
Run the game in play solo and open up the service. You should see something similar to this:

You may be wondering, "What the heck is all that?" This tutorial goes through that.

ChatServiceRunner and ChatScript
The two scripts called ChatServiceRunner and ChatScript should not be touched. Their children should not be touched either. These scripts are what make the core of the chat work.

ChatModules
This is where editing gets fun! If you open up ChatModules, you will see there are many s in it. These are what make the extra stuff, such as ChatChannels, Bots, and more!

Creating a Bot
Using ChatModules, you can create a bot! To start, create a inside of ChatModules. Inside the script, delete everything and add this: This code creates the function to be ran, and returns it. Now, any code inside of the Run function will be ran. But what is 'ChatService'? ChatService is a special Service used to manipulate different aspects of the server-side chat. Click here for all the information on the ChatService object. To start making the bot, we must create the speaker. To do this, add this line into the Run function. This code creates a speaker named the value in "botName", and returns it. Now we have created a bot, but it doesn't do anything. First you want to decide what you want your bot to do. In this tutorial, we are going to make our bot say "Hello, World!" By default, all users join the "All" ChatChannel. A ChatChannel is similar to servers, except there is no limit for the amount of people in one. Players can join a ChatChannel manually, or automatically. Scripts can be used to make a player join a chat channel, then leave one later. In order to send a message to the "All" channel, we must do two things. First, we need it to join the channel, then send the message.

You may notice this doesn't work. It in fact does. Your client is too slow to notice it. In order to fix this, put a wait right before the SayMessage. Your final code should look like this: