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

How do you check an AssetType? (MarketplaceService)

I kept looking up for how to check if it's an AudioClip from the MarketplaceService but i couldn't find a correct answer, i tried many ways but none seem to work out

This should preview what im exactly trying to do

if game:GetService("MarketplaceService"):GetProductInfo(id) == Enum.AssetType.Audio then

1 answer

✓ Accepted answer

Please do more research next time because it is very easy to find here, How you can do it is fairly simple.

local Asset = game:GetService("MarketplaceService"):GetProductInfo(id)
if Asset.AssetTypeId == 3 then
      -- Script here
end

The AssetTypeId 3 is the audio AssetTypeId, If you want to know a specific AssetTypeId there is a list of them here.

3 comments

0

Yeah i kept thinking how easy it should be but that happened

0

Welp you have my thanks

0

No problem

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