Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I change image gui by leaderstats?

Asked by 4 years ago
Edited 4 years ago

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.

01local LP = game.Players.LocalPlayer
02local Image = script.Parent
03local leaderstats = LP:WaitForChild("leaderstats")
04local Time = leaderstats:WaitForChild("Time")
05game.Players.PlayerAdded:Connect(function()
06 
07Time:GetPropertyChangedSignal("Value"):Connect(function()
08    while wait() do
09    if Time.Value >= 0 then
10        Image.Image = "rbxassetid://lmagePaceholder"
11    end
12    if Time.Value >= 60 then
13        Image.Image = "rbxassetid://lmagePaceholder"
14    end
15    if Time.Value >= 400 then
View all 44 lines...
0
When you run the code, what do you see? Is the code working? Robot_R4 2 — 4y
0
I see the first image show up, but not the rest of the images when my time value is changed OhBrotherGaminYT 11 — 4y
0
I noticed that the first 5 images are the same, is that a mistake? Robot_R4 2 — 4y
0
It is suppose to be the same image gui but different immage OhBrotherGaminYT 11 — 4y
View all comments (15 more)
0
Hold on, im looking in to it. Robot_R4 2 — 4y
0
oh, its the same gui name but with different drawing on it? Robot_R4 2 — 4y
0
yes OhBrotherGaminYT 11 — 4y
0
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. Robot_R4 2 — 4y
0
I think all the images should have numbers actually, also, where are you getting the images from? This could help a lot. Robot_R4 2 — 4y
0
How are you doing, was this helpful? Robot_R4 2 — 4y
0
I put the image id instead of ImagePlaceholder so that it could display that image OhBrotherGaminYT 11 — 4y
0
but still doesnt work OhBrotherGaminYT 11 — 4y
0
I am getting the images from my decals OhBrotherGaminYT 11 — 4y
0
Ok, good to know! Let me do some more research.. Robot_R4 2 — 4y
0
Are any pictures popping up when you run it, or nothing. Robot_R4 2 — 4y
0
Only the image that I set it to in properties. OhBrotherGaminYT 11 — 4y
0
Could you resend the code? Robot_R4 2 — 4y
0
Thankyou for being patient with me. Robot_R4 2 — 4y
0
I made a few tweaks OhBrotherGaminYT 11 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

The new script

01local LP = game.Players.LocalPlayer
02local rank = script.Parent
03Image = {}
13Image[10] = "rbxassetid://6654797490"
14Image[11] = "rbxassetid://6654797943"
15 
View all 64 lines...
0
Did this work? Robot_R4 2 — 4y
0
no OhBrotherGaminYT 11 — 4y
0
ill be back in 20 minutes or more OhBrotherGaminYT 11 — 4y
0
backk OhBrotherGaminYT 11 — 4y
View all comments (5 more)
0
Hello, im still reading your code for errors, thankyou for being patient. Robot_R4 2 — 4y
0
Since, the last program was displaying and this is not displaying instead of rewriting the code, maybe revert to the last code, and just change the "image placehold" to the Id. Or did you already try that? Robot_R4 2 — 4y
0
What last code? OhBrotherGaminYT 11 — 4y
0
Nvm i found out, and all the "image placeholders" are with the actual decal id OhBrotherGaminYT 11 — 4y
0
Yay! So glad you figured it out! Robot_R4 2 — 4y
Ad

Answer this question