Check what type of category an asset is in

Im making a messaging system where you can send images with a given decal id, but in the box where the player wants to put an id, i want to make sure that asset exists, and that its an image and not an audio or a model. How would i achieve this?

1 Like

Just figured it out! If anybody looked up this question on google heres how you can do this,

if you want to check if an asset exists just do

local s = pcall(function()
    game:GetService("MarketplaceService"):GetProductInfo(tonumber(id))
end)

if you want to find what type of asset it is

local asset = game:GetService("MarketplaceService"):GetProductInfo(id)
print(Asset.AssetTypeId)
4 Likes