Need help with string.format() and using multiple font colors

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to be able to have multiple font colors inside one message.

  2. What is the issue? Include screenshots / videos if possible!
    When I type in chat, this message shows and i’m not sure how to fix it

Here is my script:

local Players = game:GetService("Players")
local TextChatService = game:GetService("TextChatService")

local function Color(Status)
	
	if Status == "Innocent" then
		
		return Color3.fromRGB(255, 255, 255):ToHex()
		
	end
		
end

TextChatService.OnIncomingMessage = function(Message)
	
	local Properties = Instance.new("TextChatMessageProperties")
	
	if Message.TextSource then
		
		local Player = Players:GetPlayerByUserId(Message.TextSource.UserId)
		local Status = Player.leaderstats.Status.Value
		local Leaderspot = Player.Statistics.Leaderspot.Value
				
		if Player.UserId == 1838222937 then
				
			local Color = Color(Status)			
			Properties.PrefixText = string.format("<font color='ff0000'>[OWNER] </font><font color='#%s'>%s</font>", Color, Message.PrefixText)
		
	end
	
	return Properties
	
end

Pretty sure your rich text fails due to not putting a hashtag in front of “ff0000”.

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