How would I send a chat message from the server?

For example every 30 seconds it would say ‘{System}: Hi’ in the default roblox chat
How can I do this? I tried to read about the chat service on the wiki but couldn’t find anything

2 Likes

Watch this video. If you have any questions on it feel free to ask.

3 Likes

There are two ways to accomplish this, however I prefer the second method:

  1. StarterGui:SetCore() → client-sided
  2. SendSystemMessage(string message , string channelName) → server-sided

More information:

  1. https://developer.roblox.com/en-us/api-reference/function/StarterGui/SetCore
  2. https://developer.roblox.com/en-us/articles/Lua-Chat-System/API/ChatSpeaker
3 Likes

For send system message is it like a function of the game object? For example: game:Sendsystemmessage()

2 Likes

The correct way would be ChatChannel:SendSystemMessage(string) → if you want everyone to see it.

Otherwise, this will only be visible to the speaker you specify
Speaker:SendSystemMessage(string message , string channelName )

1 Like

didnt work but i think its cause its from 2017

Could you give a code example for the second one?

How do I get the default chat channel???

Hey, I ended up figuring it out btw.

1 Like

Can you leave the code? How do you get ChatChannel?

3 Likes