Need help with Rich Text

Hello!

My rich text is look wierd.
Screenshot 2025-03-07 141448
It’s a bit hard to see since its really small. But the rich text is not supposed to look like that. It is supposed to look like:
Rarity: Rarity(e.g Common) ← makes the “Rarity”(the second one) a different colour. Like Common is a grey colour.

Portion of script:

local Rarity
local RarityColour

for i, item in ipairs(IndexTable) do
	if item.name == toolHandle.Name then
		Rarity = item.Rarity
		RarityColour = item.Color
	end
end


ItemRarity.RichText = true

ItemRarity.Text = "Rarity: <font color='" .. RarityColour .. "'>" .. Rarity .. "</font>"

If rarity color is a Color3, it won’t work because roblox needs it to be a valid hex code

here’s what it look likes in that table:

Rarity = "Common", Color = "808080"}

Add a # before the color code and it should work

can you put that to code form please ?

Give it your best shot. It’s not that complicated, I promise

1 Like

Rarity = "Common", Color = "#808080"}

1 Like

does this line look good?

ItemRarity.Text = "Rarity: <font color='" .. RarityColour .. "'>" .. Rarity .. "</font>"

it should display:
Rarity: Rarity(the second rarity displays the raritycolor)

i think so that should work otherwise i’m not sure

1 Like

Yes it does work!


1 Like

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