Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a Label's text colour dependent on the player's team colour?

Asked by 5 years ago

I made an Overhead UI that shows a player's rank in group. However, I got a few teams and I want to make it so, the team the player is on, makes the UIs color the same as the team color. For example, if Visitors is green, then if the player is in that team, the GUI will be green, and if the player joins the raiders team (red team colour) the GUI will be red. I tried doing this with if statements, like:

if Player.TeamColor == green then
    UI.Label.Color3 = Color3.new(75, 151, 75)
end

Of course this script is not exactly what I have, but it may give you an idea on what I wanted to do.

Waiting for some help.

iiHypocratic

0
UI.Label.Color3 = Player.TeamColor.Color You could try something like that. maxbd 44 — 5y

1 answer

Log in to vote
0
Answered by
Narunzo 172
5 years ago
Edited 5 years ago

You could try doing something like this:

if Player.TeamColor == green then
    UI.Label.Color3==Player.TeamColor.Color
end
0
TeamColor returns a brick color, you would want to index the `Color` property of a BrickColor. EpicMetatableMoment 1444 — 5y
0
Oh okay got you then I'll change it to TeamColor.Color which will make it a color3 value. Narunzo 172 — 5y
Ad

Answer this question