Server welcoming message not working

I have a Local script which sends out a message in the chat box welcoming a player whenever they join the game. The script works in my other game, but when I copy and paste it into my new game, it doesn’t.

(FYI, I got the script off a Youtube tutorial)

game.StarterGui:SetCore("ChatMakeSystemMessage", {
    Text = "Text goes here";
    Font = Enum.Font.GothamBold;
    FontSize = Enum.FontSize.Size42;
    Color = Color3.new(255, 0, 0); 
})

Any help is appreciated!

1 Like

what chatservice version are you using? it only works on legacy chat

I honestly have no idea (I have little to no experience in scripting), but I don’t think I’m using legacy chat. How do I check for my ChatService version?

Go to TextChatService and you can check what version you’re using.

If it says “LegacyChatService” you’re using the old chat window (rectangular, not roundy) and the script will work.

If it says “TextChatService” you’re using the new chat window (rectangular but roundy) and the script won’t work.

If you want to use TextChatService, replace the script with this:

game:GetService("TextChatService"):WaitForChild("TextChannels").RBXGeneral:DisplaySystemMessage("Text goes here")

You can also use the metadata second parameter and TextChatService.OnIncomingMessage to customize the message’s color and font.

local TextChatService = game:GetService("TextChatService")

TextChatService.OnIncomingMessage = function(message)
   if message.Metadata == "SystemMessage" then -- if message is a system message
      local overrideProperties = Instance.new("TextChatMessageProperties")
      overridePropeties.Text = string.format('<font face="GothamBold" size="42" color=rgb(255,0,0)>%s</font>', message.Text)
      
      return overrideProperties
   else
      return nil
   end
end

TextChatService:WaitForChild("TextChannels").RBXGeneral:DisplaySystemMessage("Text goes here", "SystemMessage") -- you can customize the metadata parameter anything you want, as long as you change it too in line 5

To change the color of the message, first create a TextChatMessageProperties instance, then set its text to the message text with Rich Text Markup, and finally return it.

If you don’t know what Rich Text Markup is, it basically changes the color and font of a string using commands enclosed with <>, like in HTML.

Learn more about TextChatService and Rich Text here:

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.