Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do multi-color chat announcements work?

Hello. I am making a GUI that lets admins announce anything into the chat anonymously, but I also want to replicate the multi-color that ROBLOX's official chat uses. The result I am looking for is:

(Red) [Game Announcement]: (white) This is a test announcement!

I know how to send the announcement to chat, using this code:

CreateMessage = function(text, color, font, size)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = text;
	Color = color;
	Font = font;
	FontSize = size;
	})
end

script.Parent.MouseButton1Click:connect(function()
	CreateMessage(game.Chat:FilterStringForBroadcast(script.Parent.Parent.TextBox.Text, script.Parent.Parent.Parent.Parent), Color3.new(255/255, 88/255, 88/255), Enum.Font.SourceSans, Enum.FontSize.Size24)
end)

but despite what I've tried, I can't seem to change the color. All of my results change the color of the entire message, not just part of it.

Is there any event/function I'm missing?

1 answer

Textlabels / TextBoxes dont have individual colors. The instance will color the entire text as one color. You would need some fancy unicode work for multiple colors; by changing the position of multiple Instances based on the pixel width of the characters inside.

2 comments

0

he wants to do that with chat

0

Oh.

This discussion is preserved as it was. New answers, comments, and votes are closed.