Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I check if a Image ID is an actual Asset?

I want to find out if when a Players adds an image ID if the image ID is valid.

1 answer

function IsImageValid(id)
local isimage
    local success,message = pcall(function()
    local imageid = game:GetService('MarketplaceService'):GetProductInfo(id) 
isimage = imageid.AssetTypeId == 1
    end)
  return success and isimage
end 

Pretty much the same thing as the IsGameValid function, but it does it for images.

2 comments

0

Make sure to use isimage = imageid.AssetTypeId == 1 or imageid.AssetTypeId == 13 if you wish to also include decals.

0

^ yes, but there's no way I know of to convert decal ids to image ids

This discussion is preserved as it was. New answers, comments, and votes are closed.