Image preview not showing up

I am trying to implement a system where you can purchase a developer product to have an advertisement show on one server for 5 or 10 robux until the server closes, but the image preview for the ad just doesn’t load. Here’s the code for the script that should load it.

local function OnClicked()
	script.Parent.Parent.ImageLabel.Image = tostring("rbxassetid://"..script.Parent.Parent.Id.Text)
end

script.Parent.MouseButton1Click:connect(OnClicked)

The most annoying part about this is it puts that text into the ImageLabel, but the image label doesn’t refresh it and I can’t figure out why.

Try using this link instead of “rbxassetid://”

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

So it would be

local function OnClicked()
	script.Parent.Parent.ImageLabel.Image = tostring("rbxthumb://type=Asset&id="..script.Parent.Parent.Id.Text.."&w=150&h=150")
end

script.Parent.MouseButton1Click:connect(OnClicked)

Content Data types

1 Like

Wow! I don’t know what changed but it worked like a charm! Thank you!

Edit: Just saw the content data types link, I’ll look through it!

1 Like

The reason it probably didn’t work was because you were giving a decal id instead of an image id, that link does the conversion for you!

If you hae anymore issues don’t be afraid to make another post!

1 Like

Oh, that makes more sense now, good to know. And, again, thank you!

1 Like