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

How do you check an AssetType? (MarketplaceService)

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
Yeah i kept thinking how easy it should be but that happened Stalkalek 2 — 4y
0
Welp you have my thanks Stalkalek 2 — 4y
0
No problem Trading_Opportunity 191 — 4y
Ad

Answer this question