Rich Text Coloring by script not working right

So basically I am making this popup where when you are given an item by someone else it pops up with like
PLAYERNAME has given you !, and the itemhere should be colored, however it seems to error in script when I do it like this

´´´

..Player1.Name.." has given you &lt; <font color="rgb(255,165,0)">Stick</font> &gt;

´´´
It works fine on GUI but it errors at rgb(255,165,0) by script, how would I be able to fix this?

oh damn its richtexting in here hold on

Has rich text been enabled in the object?
Also, what is the error?

Rich text is enabled and it doesn’t print anything but nothing happens, I put it in a functional tool I get on spawn and the tool stopped working. But there are no prints.

The second " can bring issues, as the program might think the string ends there. It might work if you replace it with:

..Player1.Name.." has given you &lt; <font color='rgb(255,165,0)'>Stick</font> &gt;

I’ve tried the snippet in my own place, and there it does seem to work.

local Player1 = game.Players.LocalPlayer
script.Parent.Text = "A " ..Player1.Name.."has given you &lt; <font color='rgb(255,165,0)'>Stick</font> &gt;"

(localscript as a child of the textlabel.)

3 Likes

Thank you! It works how I wanted it to!