✓ Accepted answer
Your mistake is in the quotes, you can use double quotes(") and single (') to separate the strings,
try this
word.Text = "<font color='#00BE00'>"..Variable1.."</font><font color='#FF0000'>"..Variable2.."</font>"
if you only will use rich text for color, you can make a function to make it easyer
local function toRichText(...)
local args = {...}
local texts = {}
for i,v in next, args do
local colors ={v[2].R, v[2].G, v[2].B}
texts[i] = "<font color='rgb("..table.concat(colors, ', ')..")'>"..v[1].."</font>"
end
return table.concat(texts, '')
end
word.Text = toRichText({'Hello', Color3.new(0, 170, 255)})
word.Text = toRichText(
{'Hello', Color3.new(0, 170, 255)},
{', how are you?', Color3.new(0,0,0,0)}
)
1 comment
Tysm