Hello! I am trying to change the image of the gui depending on the leaderstats. It is in serverStorage because that is where the billboard gui is in
EDIT 1: BTW it is a overhead Gui
Here is the code.
local LP = game.Players.LocalPlayer local Image = script.Parent local leaderstats = LP:WaitForChild("leaderstats") local Time = leaderstats:WaitForChild("Time") game.Players.PlayerAdded:Connect(function() Time:GetPropertyChangedSignal("Value"):Connect(function() while wait() do if Time.Value >= 0 then Image.Image = "rbxassetid://lmagePaceholder" end if Time.Value >= 60 then Image.Image = "rbxassetid://lmagePaceholder" end if Time.Value >= 400 then Image.Image = "rbxassetid://lmagePaceholder" end if Time.Value >= 500 then Image.Image = "rbxassetid://lmagePaceholder" end if Time.Value >= 1000 then Image.Image = "rbxassetid://lmagePaceholder" end if Time.Value >= 1200 then Image.Image = "rbxassetid://6654794864" end if Time.Value >= 1600 then Image.Image = "rbxassetid://6654795945" end if Time.Value >= 2000 then Image.Image = "rbxassetid://lmagePaceholder" end if Time.Value >= 3000 then Image.Image = "rbxassetid://lmagePaceholder" end if Time.Value >= 6000 then Image.Image = "rbxassetid://ImagePlaceholder" end if Time.Value >= 1000 then Image.Image = "rbxassetid://lmagePaceholder" end end end) end)
The new script
local LP = game.Players.LocalPlayer local rank = script.Parent Image = {} Image[1] = "rbxassetid://6654744240" Image[2] = "rbxassetid://6654785682" Image[3] = "rbxassetid://6654786566" Image[4] = "rbxassetid://6654787618" Image[5] = "rbxassetid://6654788713" Image[6] = "rbxassetid://6654794864" Image[7] = "rbxassetid://6654795945" Image[8] = "rbxassetid://6654796495" Image[9] = "rbxassetid://6654797149" Image[10] = "rbxassetid://6654797490" Image[11] = "rbxassetid://6654797943" local leaderstats = LP:WaitForChild("leaderstats") local Time = leaderstats:WaitForChild("Time") Time.Changed:Connect(function(newvalue) if newvalue <= 60 then rank.Image = (Image[1]) else if newvalue <= 400 then rank.Image = (Image[2]) else if newvalue <= 500 then rank.Image = (Image[3]) else if newvalue <= 1000 then rank.Image = (Image[4]) else if newvalue <= 1200 then rank.Image = (Image[5]) else if newvalue <= 1600 then rank.Image = (Image[6]) else if newvalue <= 2000 then rank.Image = (Image[7]) else if newvalue <= 3000 then rank.Image = (Image[8]) else if newvalue <= 6000 then rank.Image = (Image[9]) else if newvalue <= 10000 then rank.Image = (Image[10]) else if newvalue <= 99999999999999999 then rank.Image = (Image[11]) end end end end end end end end end end end end)