ImageLabel not changing

Hi! My name is Chris and I have recently been working on a Purchase Center. I was looking for problems and noticed that my ImageLabel won’t change when the script changes the Image link.

Image Label can be seen here

Main Scripting:

-- Declaring variables
local Values = game:GetService("ReplicatedStorage").UICredentials.ScriptValues
local CS = Values.CurrentScreen
local CI = Values.CurrentImage
local ImprovedCAD = script.Parent.ImprovedCAD
local ICADP = script.Parent.ImprovedCADPurchase
local PurchaseButton = script.Parent.Purchase


--Change Picture
ImprovedCAD.ChangePicture.MouseButton1Click:Connect(function()

if CI == 1 then
	
	CI = 2
	ImprovedCAD.MainPicture.Image = "rbxassetid://3377636623"--ChooseRolePicture
	
elseif CI == 2 then
	
	CI = 3
	ImprovedCAD.MainPicture.Image = "rbxassetid://3377636200"--PDSystemPicture
	
elseif CI == 3 then
	
	CI = 1
	ImprovedCAD.MainPicture.Image = "rbxassetid://3377635876" -- LoginFormPicture
	
end

end)

I checked the CI value as well, it is currently set to one seen here

An explorer picture can be seen here

Any help is appreciated!

What’s .ChangePicture? I feel like that could be causing it since it is not defined within the code. There is no error, right?

There is no error,I tried checking for errors on multiple occasions. I will update the text with a picture of the explorer.

Oh, I know what it is. Instead of doing .MouseButton1Click, you are better off doing .MouseButton1Down. .MouseButton1Click fires the event whenever the mouse goes down and then back up. Try that and get back to me.

I tried that and unfortunately, no change.

I noticed your CS and CI do not have any .Values whenever something is defined, the if statements. if CI.Value == 1 then maybe that could be it?

If that isn’t it, upload the image as a decal and let it sit on a brick for a couple of minutes. Images break sometimes, I’ve had this occur to me, and that had worked after a while.

Good catch! It seems it was the Value. Silly me! When I did that, I was greeted with another problem but I will look into it more; https://gyazo.com/723770de815db550dc8507edb4a80563

1 Like

Glad to help! I do that a lot to, it happens to the best of us. Have a great rest of your day now.

1 Like