I am trying to change the BackgroundColor3 of an ImageLabel whenever the players’ stat reaches a certain value, but it doesn’t change. There are also no errors in the Output.
game.Players.PlayerAdded:Connect(function(Player)
local Value = Player:WaitForChild("Folder").Value
local Color = Player.PlayerGui:WaitForChild("Gui").Frame.ImageLabel.BackgroundColor3
while true do
wait(0.1)
if Value.Value <= 75 then
Color = Color3.fromRGB(75, 153, 54)
elseif Value.Value <= 50 then
Color = Color3.fromRGB(212, 189, 17)
elseif Value.Value <= 25 then
Color = Color3.fromRGB(163, 21, 21)
elseif Value.Value <= 1 then
Color = Color3.fromRGB(163, 21, 21)
end
end
end)
Is there a way to fix this?