{Closed} ImageColor3 not changing after second time

So I’m trying to change the color of an image. I understand you can only change the darkness and brightness. However, the image base color is white. When the player selects a team, the image color changes to the team color. However, when they respawn, the color doesn’t change properly. It just stays the same white color. (The code is no different)

local guilevel = char.Head:WaitForChild("guilevel")
if guilevel == nil then return end
if player.Team.Name == "Dominators" then
	guilevel.frame.ImageColor3 = Color3.fromRGB(0, 85, 255)
else
	guilevel.frame.ImageColor3 = player.TeamColor.Color
end

Does the color change when the player chooses a team?

Yes the color changes when the player selects a team. However when they respawn it doesn’t change to the color it was told too.

When does that line run? Is it wrapped inside a CharacterAdded event or its just wrapped inside a MouseButton1Down event.

So the team selecting is inside a remote event. However, when the player respawns, it is wrapped inside a CharacterAdded event.

I assume

function onPlayerAdded(plr)
  plr.CharacterAdded:Connect(function()
     wait(1)
     local guilevel == char:WaitForChild("Head"):WaitForChild("guilevel")
      guilevel.frame.ImageColor3 = plr.TeamColor.Color

Is the characteradded something like that? If not then try it.
(Dont wrap it inside a remote event and yes I know theres an if dominator )

Yeah, that didn’t seem to solve the issue for the CharacterAdded. I don’t believe its an issue with the event. I think it has to do with the color. For example, the color3 is supposed to be 0,84,244. However, I’n the output it prints the color to be:

1, 0.34902, 0.34902

I just realized your code is

player.TeamColor.Color

Try

player.Team.TeamColor.Color

If that doesnt work then you should print the team name to check.

Nope that didn’t resolve the issue.

Code:
image

The output for the last print statement shows,

1, 0.34902, 0.34902

When it should be showing:

0,85,255

Okay, I’ve found the solution, I made a silly mistake. It has nothing to do with the color. I manually changed it back to the original color before the script ends.