Image Change script not working?

Hi! I am currently making a settings menu that contains checkboxes. I made a simple script so when you click the checkbox ImageButton, it changes it’s image. Here’s that script.

local ImageButton = script.Parent

ImageButton.MouseButton1Click:Connect(function()
	ImageButton.Image = "rbxassetid://10089834661"
end)

But for some reason, when I playtest, the entire button just goes away?
Here’s the image it’s supposed to change to, not deleted or anything. - Image

No errors in output.
This could be a pretty easy fix, but I just can’t figure anything out.

Most likely it’s because it’s not an Image Id but rather for decals, try putting that image you sent into an ImageLabel/ImageButton, copying the Image property that it now has and use that instead

1 Like

Maybe button was not activated.

Try changing "rbxassetid://10089834661" into "http://www.roblox.com/asset/?id=10089834656"

I tried your decal link in Roblox Studio and it wouldn’t update, so I tried mine and it worked fine.

It’s active, weird.
image

That didn’t work either. I tried a random decal off of the toolbox just to make sure it was the script and the button still went away.

Try this out?

"rbxthumb://type=Asset&id=10089834661&w=150&h=150"

Where I found it

2 Likes

Are you sure the image transparency property is set to 0?

So the button and image exists, but when you click it, it gets deleted?

Worked! Thank you!

char limit

2 Likes