So, I'm making an in game ID card. In my game, there are 6 soul colors that are each represented by a number. There's also an integer value (created in another script) that's stored within the players character. It's called "Color." I'm trying to have the script find that value, and then change the color of a GUI frame to fit the persons chosen color on the ID card. It isn't working and I've tried a BUNCH of stuff.
local Player = game:GetService("Players")
local frame = Player.PlayerGui.IDCardGui:FindFirstChild("ColorFrame")
game.Players.PlayerAdded:Connect(function(player)
print("Player added detected")
player.CharacterAdded:Connect(function(character)
print("color script started")
local ColorValue = character:FindFirstChild("Color")
if not ColorValue then return end
print("color value found")
if ColorValue == 1 then
print("color value is red")
frame.BackgroundColor3 = Color3.fromHSV(0.666667, 0.333333, 1)
print("color loaded!")
end
end)
end)
I've (obviously) tried to use prints to tell me what's working and what isn't, but absolutely none of them have shown up. Please bare with me, I don't usually work with Players.
How do I get the script to find the value and change the gui? Any help is appreciated!

1 comment
Line 11: "ColorValue" -> "ColorValue.Value"