Overhead GUI - The color of textlabel doesn't change

Hello,
I’ve been trying to configure a overhead rank GUI that shows your username and rank in a specific group. I would like the textlabel’s color inside the GUI to change depending on the player’s team. I tried many approaches against this problem, yet I still couldn’t figure it out. I looked up on a few articles and roblox developer hub. The overhead GUI works nice and neat, however the textcolor of the textlabel doesn’t change. I think this might be an issue about server-client connections, but I’m not sure.

Any help would be much appreciated.

image

(The code wasn’t like this before, I edited it a few times. None of my approaches worked. Note that this is a serverscript located in ServerScriptService)

Change the value stored in a variable would not change your object.

Try this:

local textLabel = script.OverheadGui.InformationLabel
textLabel.TextColor3 = Color3.new(0, 0, 0)  -- Put your color
2 Likes

That did not seem to work, I had an issue before that was related to the thing that you mentioned. However, I think at this case, it’s not the solution.

1 Like

Ok, is there any error in output?

Sadly, no. There’s none. That’s why I think it might be related to client-server issues.

(It’s a serverscript by the way)

1 Like

Maybe try replacing Player.TeamColor with:
If Player.TeamColor == BrickColor.new("White") then

1 Like

What if you use:

if Player.TeamColor = BrickColor.White() then

Honestly, I don’t know if will solve, but TeamColor is a BrickColor.

Try changing the TextColor3 on the information label that you cloned to the player’s character to the color instead of changing the informationlabel parented to the script.

1 Like

I used if Player.TeamColor = BrickColor.new(“White”) instead, and it did not work. I didn’t use BrickColor.White() because its not really specific enough for my requirements, including the other colors such as Maroon, Toothpaste et cetera.

1 Like

I already did that at my previous attempts and sadly it did not work as I expected.

I assume ou mean something like:

GuiClone.InformationLabel.TextColor3 = Color3.new(values)

If so, I did that after I received a reply at this topic and it did not work.

It’s not Color3.new , it’s Color3.fromRGB. Try using that instead.

1 Like

I changed Color3.new to Color3.fromRGB and the combinations using the BrickColor codes page at Roblox Developer Hub, and it did not seem to work. The textlabel’s color stays as same. I don’t think there’s such difference between Color3.new and Color3.fromRGB, aren’t they 2 ways of using Color3?

The reason why it isn’t working is because you never set the property in the first place. On your variable color, that only gets the value of the property. It does NOT set the property. This is easily fixed by: (step by step)

  1. Remove the color variable
  2. For every if and elseif statement, do:
InformationLabel.TextColor3 = Color3.new(theen,add,number)

Since your code is a picture, I cannot paste it here. I can type it, but it takes a lot of time.

Hello,

I tried your solution. I deleted the color variable from the script and replaced the lines with:

InformationLabel.TextColor3 = Color3.new(0.294118, 0.592157, 0.294118) (example line for one team)

Sadly, it seems that its not working. Am I doing something wrong? If so, correct me please.

It’s better for you to paste (not picture, please) the code you have right now. This will give us more information.

Can I see the hierarchy of the OverheadGui?

image

I feel like the error might be in the GuiClone variable.
I think that it should just be OverheadGui:Clone() not with the script.