So I’ve made a chat system, where the name of the player will be displayed in a color according to him or her’s team. Everything works fine right until it’s time to set the color with variables and suddenly it all breaks.
(I’ve tried tostring)
local Color = Player.Team.TeamColor.Color
local R,G,B
R = Color.R * 255
G = Color.G * 255
B = Color.B * 255
--Manual color line:
TextLabel.Text = '<font color="rgb(255,125,0)">['..Player.Name..']:</font>'.._message
--Color set by variables line:
TextLabel.Text = '<font color="rgb('..R..","..G..","..B..')">['..Player.Name..']:</font>'.._message
Result of manual:
Result of color set by variables: (Which doesn’t work)
local Color = Player.Team.TeamColor.Color
local R,G,B
R = Color.R * 255
G = Color.G * 255
B = Color.B * 255
TextLabel.Text = `<font color="rgb({R},{G},{B})">[{PlayerName}]:</font>{_message}`
local Color = Player.Team.TeamColor.Color:ToHex()
--Manual color line:
TextLabel.Text = '<font color="rgb(255,125,0)">['..Player.Name..']:</font>'.._message
--Color set by variables line:
TextLabel.Text = "<font color=\""..Color.."\">["..Player.Name.."]:</font>".._message
local Color = Player.Team.TeamColor.Color:ToHex()
--Manual color line:
TextLabel.Text = '<font color="rgb(255,125,0)">['..Player.Name..']:</font>'.._message
--Color set by variables line:
TextLabel.Text = "<font color=\"#"..Color.."\">["..Player.Name.."]:</font>".._message