Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
uhTeddy 101
6 years ago

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

1 answer

Log in to vote
0
Answered by 6 years ago
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.

0
Make sure to use `isimage = imageid.AssetTypeId == 1 or imageid.AssetTypeId == 13` if you wish to also include decals. IPsec 35 — 6y
0
^ yes, but there's no way I know of to convert decal ids to image ids brokenVectors 525 — 6y
Ad

Answer this question