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)

19 comments
When you run the code, what do you see? Is the code working?
I see the first image show up, but not the rest of the images when my time value is changed
I noticed that the first 5 images are the same, is that a mistake?
It is suppose to be the same image gui but different immage
Hold on, im looking in to it.
oh, its the same gui name but with different drawing on it?
yes
I think you need to rename the images with different names since there different pictures, the program is displaying the gui, which is great, but since there are different images with the same label, it is probably getting confused.
I think all the images should have numbers actually, also, where are you getting the images from? This could help a lot.
How are you doing, was this helpful?
I put the image id instead of ImagePlaceholder so that it could display that image
but still doesnt work
I am getting the images from my decals
Ok, good to know! Let me do some more research..
Are any pictures popping up when you run it, or nothing.
Only the image that I set it to in properties.
Could you resend the code?
Thankyou for being patient with me.
I made a few tweaks