So basically I’m trying to make a system, that gets the players teamcolor and changes a textlable texcolor to that. Easy enough right? Well, I also have another text label that needs to be the teamcolor but a few shades darker. I have a script that I found on the forum but it doesn’t work.
Script:
-- UI Variables
local text = script.Parent.PlayerName
local text2 = script.Parent.PlayerName.PlayerNameShadow
local text3 = script.Parent.TeamText
local text4 = script.Parent.TeamText.TeamTextShadow
local PLAYER = game.Players.LocalPlayer
local Color = PLAYER.Team.TeamColor.Color
local R,G,B
R = Color.R * 255
G = Color.G * 255
B = Color.B * 255
while true do
wait(.001)
text2.Text = text.Text
text4.Text = text3.Text
text3.TextColor3 = Color3.fromRGB(R,G,B)
end
TeamColor is stored as a BrickColor value whereas color for “TextLabel” instances is stored as a Color3 value.
-- UI Variables
local text = script.Parent.PlayerName
local text2 = script.Parent.PlayerName.PlayerNameShadow
local text3 = script.Parent.TeamText
local text4 = script.Parent.TeamText.TeamTextShadow
local PLAYER = game.Players.LocalPlayer
local Color = PLAYER.TeamColor
local R, G, B = math.round(Color.r * 255), math.round(Color.g * 255), math.round(Color.b * 255)
while task.wait() do
text2.Text = text.Text
text4.Text = text3.Text
text3.TextColor3 = Color3.fromRGB(R,G,B)
text4.TextColor3 = Color3.fromRGB(R-30,G-30,B-30)
end