How can i make a ui change color when you get a certain leaderstat value

i think the script would have to be different if its under the key but idk which script to put
i can try and figure it out tho

@AdSomnum It seems like you typed BackgroundColor which is a BrickColor, the solution would be to change it to BackgroundColor3

local player = game.Players.LocalPlayer
local Keys = player:WaitForChild("Keys")

local function Change()
if Keys.Value == 2 then -- change 2 to the number of keys you want it to change the colour for
player.PlayerGui:WaitForChild("Collectibles"):WaitForChild("Key").BackgroundColor3 = Color3.fromRGB(0,0,0) -- click on the numbers in the script and it will let you change the colour via a palette
 end
end

Keys:GetPropertyChangedSignal("Value"):Connect(Change)
Change()

i changed it to image color since it since its the image that im changing color but im not sure were to put the script and stuff like that

i wanted the script to be parented to the key ui that changes color so there would be a script under each key

1 Like

I took @AdSomnum script and it seems like you can put in StarterGui also make sure it’s ImageColor3 and not ImageColor

1 Like