Okay so I’m making a group overhead and it’s using teams so it will be like:
(name)
(team)
(team’s rank)
and I would like colors, how would I do that? so like the (team) part would have the teams color aswell.
Okay so I’m making a group overhead and it’s using teams so it will be like:
(name)
(team)
(team’s rank)
and I would like colors, how would I do that? so like the (team) part would have the teams color aswell.
Team.TeamColor doesn’t work?
if you want the Color3
instead of the BrickColor use this function
function transformToColor3(col)
local r = col.r
local g = col.g
local b = col.b
return Color3.new(r,g,b);
end
How would I do that? Let’s say civilian team is white and police is blue if I was on police team I don’t want it just to be a gray text I want it to be that blue color I put in the team.
function transformToColor3(col)
local r = col.r
local g = col.g
local b = col.b
return Color3.new(r,g,b);
end
TeamLabel.TextColor3 = transformToColor3(player.Team.TeamColor)
And also there is a group, and I don’t want to do like 10 group id’s
Well how else would you do it? This is probably why you shouldn’t have like 10 groups for one game
They’re divisions, it’s an army based game thing, I just want to find a teams color in a brick colors
Yes so player.Team.TeamColor should work
then do what i said earlier convert it into Color3
function transformToColor3(col)
local r = col.r
local g = col.g
local b = col.b
return Color3.new(r,g,b);
end
TeamLabel.TextColor3 = transformToColor3(player.Team.TeamColor)
maybe:
local color = game.Teams.TeamHere.TeamColor
There are 2 types of color, Color3
and BrickColor
you can get a Color3
from a BrickColor
by saying BrickColor.Color
local BC = BrickColor.new()
local C = BC.Color
-- a Player's TeamColor is a BrickColor, so the same can be done
local TeamColor = Player.TeamColor.Color
It Underlines in red.
I believe the exact way of getting a color from a brickcolor in this case is
newOverhead.Group.TeamLabel.TextColor = player.Team.TeamColor.Color
Since from what I could tell TeamColor is a brickcolor, you use the .Color
property to get the Color3
It justs disband,
and get this error
So TeamColor needs what’s called a Color3 Value. So, you can either do an “if” statement that relates the name of your team, so for example:
if player.Team.Name == "Red Team" then
newOverhead.Group.TeamLabel.TextColor = Color3.fromRGB(r,g,b)
end
I know there’s an easier way, but since the other methods aren’t working, this is what I got for you.
Also, for the above error, TeamLabel should be the name of whatever is inside of “Group”. It’s not a scripting error, it’s a hierarchy error. Check where your GUI is located.
The error is not due to the code I gave you, the issue is due to the hierachy you gave it to the textlabel, you need to fix that up a bit. If you’re stil lconfused, you could show us where the script and the label are located. And I realised that I for to put a 3 in TextColor
, it should be TextColor3
Also completely un related but is there a way to go like if player isInTeam then
do the rank code.
You want to check if the player is in a team before doing the code to change the rank color?