Type Decal ID into textbox and displays on a image Label

This is what i have no errors it just doesn’t display the image.

local plr = game.Players.LocalPlayer
local textbox = plr.PlayerGui.ScreenGui.Frame.picture.TextBox
local image = plr.PlayerGui.ScreenGui.Frame.picture.ImageLabel


textbox:GetPropertyChangedSignal("Text"):Connect(function()
	image.Image = "http://www.roblox.com/asset/?id="..textbox.Text		
end)
1 Like

I just tested it, the problem is that the ID has to be an image id instead of a decal id.

2 Likes

How about instead of http://www.roblox.com/asset/?id=
try this > rbxassetid://

2 Likes

If the ID is an image/decal ID, it should work with the rbxassetid:// header.

If it is an asset ID, You need to convert it to an image ID. Studio does this by default if you use the explorer and input the ID into the Texture/Image field (without any headers, just the number) and then it willl change into the image ID with header that you can use in scripts.

It is kind of confusing because you would think it would work both ways because the header has “asset” in the name, but that is for 3D content. 2D content gets converted to a new ID that is then used for UI or Decal/Texture objects. Remember having to add 1 or 2 to the ID to get the image? now-a-days you have to add anywhere from 10 to 20 or more!

2 Likes

You need to use the assetId of the decal, not the decalId itself, you can get the assetId by pasting the original decalId into the “Image” property of an “ImageLabel” or “ImageButton” instance, the value will automatically update from the decalId to an assetId.

1 Like

Probably because you’re using the decal ID which is different from the image ID. If you want to find a decal’s image ID, you can copy the image into studio, wait for its ID to change and copy the new number.

1 Like

I already did that it didn’t work

1 Like

how do i convert a decal to a image id

1 Like

I guess this could help you

2 Likes