Hello,
This is a simple guide to make system chat messages (The ones that happened every so often)
-
First, create a LocalScript and place it in StarterPlayer > StarterPlayerScripts.
-
We will be using the TextChatService and TextChannels so we will insert the following line of code:
local TextChannels = game:GetService("TextChatService"):WaitForChild("TextChannels")
- Once you have done that, we will create a table full of our messages. (You can use a ModuleScript for this if you really want too)
local messages = {
"Custom Message One!",
"Custom Message Two!",
"Custom Message Three!",
}
- Now we can really bring our creation to life. We will add a loop that will select a message at random and send the message in the roblox chat.
while wait(120) do -- Change the number in wait() to delay the messages. Is in seconds.
local pickMessage = messages[math.random(1, #messages)]
TextChannels.RBXSystem:DisplaySystemMessage(pickMessage)
end
- To use custom colours and fonts you can edit the message with HTML. For example, to turn a message a nice blue colour you can change a message in the messages table to this. (You can find more on HTML Text Formatting here)
"<font color='#00C3FF'> Custom Message Four! </font>",
Our final script should look something like this!
local TextChannels = game:GetService("TextChatService"):WaitForChild("TextChannels")
local messages = {
"Custom Message One!",
"Custom Message Two!",
"Custom Message Three!",
"<font color='#00C3FF'> Custom Message Four! </font>",
}
while wait(120) do -- Change the number in wait() to delay the messages. Is in seconds.
local pickMessage = messages[math.random(1, #messages)]
TextChannels.RBXSystem:DisplaySystemMessage(pickMessage)
end
Please give this post a like if this helped you out, and feel free to ask any questions here and I will try and help you as soon as I am able too!