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);
})
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?
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: