how to check if an image ID or decal is valid in Roblox

Learn how to check if an Image ID or Decal ID is valid in Roblox using the MarketplaceService:GetProductInfo() function. Follow this example code.

To check if an Image ID or Decal ID is valid in Roblox, you can use the MarketplaceService:GetProductInfo() function. This function returns information about an asset, including its type. Here’s an example of how to use this function to check if a given ID is a valid decal:

local MarketplaceService = game:GetService("MarketplaceService")

local function isValidDecal(id)
    local success, info = pcall(MarketplaceService.GetProductInfo, MarketplaceService, id, Enum.InfoType.Asset)
    if success and info.AssetTypeId == 13 then
        return true
        return false

local decalId = 5365990751 -- Replace this with the ID you want to check
if isValidDecal(decalId) then
    print("Valid decal")
    print("Invalid decal")

In this example, replace decalId with the ID you want to check. The function isValidDecal will return true if the ID is a valid decal and false otherwise[1].


By Perplexity at

Scroll to Top