How to get Image Id out of Decal?

So basically you know how theres an decal link right?

now the image link is this

That’s literally the same thing, but one is the official upload file and one is the decal you can add to your inventory.

I can’t use it in my scripts it isn’t the same thing :frowning:

But, it really is the same thing…

not really I show you why;
image

now when I use the other id that I got via image id from decal id
image

Add the link to a Decal, take the new URL, and delete the Decal.

doesn’t work at all sadly, I need to find out what ROBLOX API to use.

There is no such API right now, but it will be added in the future. For now you can use this:

local InsertService = game:GetService("InsertService")
local MarketplaceService = game:GetService("MarketplaceService")

function getImageIdFromDecal(decalId)
	local assetInfo = MarketplaceService:GetProductInfo(decalId, Enum.InfoType.Asset)
	
	assert(assetInfo.IsPublicDomain)
	assert(assetInfo.AssetTypeId == Enum.AssetType.Decal.Value)
	
	local decal = InsertService:LoadAsset(decalId):FindFirstChildWhichIsA("Decal")
	return decal.Texture
end

print(getImageIdFromDecal(3339338289))
1 Like