Since Roblox’s solution for multiple colors in a single strand of text was RichText, I tried using it for my game. The issue is this is basically impossible when trying to set the Color within a script. I have the RGB values of the two colors I want, but the richText code isn’t properly formatting. Here:
events.PlayerEvents.PlayerDied.OnClientEvent:Connect(function(target, killer)
local targetName = target.Name
local killerName = killer.Name
local targetTeamColor = Color3.fromRGB(255,255,255)
local killerTeamColor = Color3.fromRGB(255,255,255)
if game.ReplicatedStorage.Players:FindFirstChild(target.UserId) then
if target.UserId ~= player.UserId then
local targetTeam = game.ReplicatedStorage.Players[target.UserId].GameData.Team.Value
local targetTeamColor = game.ReplicatedStorage.Gamemodes.Mode.Teams[targetTeam].Color.Value
end
end
if game.ReplicatedStorage.Players:FindFirstChild(killer.UserId) then
if target.UserId ~= player.UserId then
local killerTeam = game.ReplicatedStorage.Players[killer.UserId].GameData.Team.Value
local killerTeamColor = game.ReplicatedStorage.Gamemodes.Mode.Teams[killerTeam].Color.Value
end
end
local feedGui = player.PlayerGui.GameGui.Feed
local feedBar = feedGui.UIGridLayout.Sample:Clone()
feedBar.FeedText.Text = "<font color= "rgb(255,0,0)"> Y35X </font> KILLED <font color= "rgb(0,0,255)"> GGEMoyer </font>"
end)
I can’t input the color3 values I want to begin with because the text won’t properly format.
How can I create multi-colored text labels? I see it in games like Arsenal, Mad Paintball, etc., where the kill feed has strings of text with multiple colors, but this solution doesn’t appear to work.