How to change color of the text

HOW TO CHANGE COLOR OF THE TEXT

game.Players.PlayerAdded:connect(function(plr)
	plr.Chatted:connect(function(msg)
		if string.sub(msg,1,3) == "/me" then
			print(1)
		end
	end)
end)
2 Likes

Color of what text? The color of the text in the chat or of a textlabel?

4 Likes

the color of the text in the chat

2 Likes

You’re gonna have to use TextChatService.OnIncomingMessage (might only work for the new TextChatSystem not Legacy)

Look at the code snippet from a staff member

2 Likes

To add onto what @Doomcolp mentioned

local TextChatService = game:GetService("TextChatService")

TextChatService.OnIncomingMessage = function(textChatMessage)
	if not textChatMessage.TextChannel then return nil end
	
	if string.sub(textChatMessage.Text, 1, 3) == "/me" then
		local overrideProperties = Instance.new("TextChatMessageProperties")
		overrideProperties.Text = string.format("<font color='#555555'>%s</font>", textChatMessage.Text)
		return overrideProperties
	end
	
	return nil
end
4 Likes

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