0

Unable to find value in player?

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")

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)
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!

0
Line 11: "ColorValue" -> "ColorValue.Value" 9mze 178 — 9d

0
NykoVania 198
13 days ago

Does this print anything?

local Player = game:GetService("Players")
local frame = Player.PlayerGui.IDCardGui:FindFirstChild("ColorFrame")

print("color script started")
local ColorValue = character:FindFirstChild("Color")
if not ColorValue then
print("color value found")
return
end
if ColorValue == 1 then
print("color value is red")
frame.BackgroundColor3 = Color3.fromHSV(0.666667, 0.333333, 1)