Having trouble with richtext inside script

Having trouble with richtext

richtext property is enabled

local textVar = "<tag><font color = rgb(0, 0, 255)>"..Char.Name.."</font>".." ".."Has".." "..killMessage[math.random(1, #killMessage)].." "..EnemyChar.Name.."</tag>"

image

1 Like

Did you take a look at this post? How do I use rich text inside a script?

Also, try this:

local textVar = "<tag>""<font color = rgb(0, 0, 255)>"..Char.Name.."</font>".." ".."Has".." "..killMessage[math.random(1, #killMessage)].." "..EnemyChar.Name.."</tag>"
1 Like

I have but its just not working

i get red when i do this
image

Try removing the tag and /tag completely? Does that affect anything?

1 Like

image

same thing

image

hmmm try this code:

local textVar = "<font color = rgb(0, 0, 255)>".. Char.Name .."</font>".. "Has" ..killMessage[math.random(1, #killMessage)].. EnemyChar.Name
1 Like

its not working, this is so frustrating

1 Like

Are there any errors? What does it show?

1 Like

no errors :frowning: i don’t get this

Can I see what the text looks like in the UI

1 Like

i got bold to work

image

image

I think the problem was using a variable for text

1 Like

Set your Textlabel.text equal to the code

1 Like

I got bold to work but color isn’t working

image

try this for color

local textVar = "<font color=\"rgb(0,0,255)\">".. Char.Name .."</font>".. "Has" ..killMessage[math.random(1, #killMessage)].. EnemyChar.Name
1 Like

Try using your original code and see if it works.

2 Likes

I checked the textlabel and its empty
image

Did you set your original code equal to the textlabel.text?

no I changed it up a bit

this is what I have right now

local textVar = "<tag><font color = rgb(255, 0, 0)>"..Char.Name.."</font>".." ".."Has".." "..killMessage[math.random(1, #killMessage)].." "..EnemyChar.Name.."</tag>"
TextLabel.Text = "<font color = rgb(255, 0, 0)>".."this is starting to really suck".."</font>"

im not using the variable anymore just using a string

Try adding the tags back. It may be just your variable.

not working::frowning:image