How do I detect if Bundle or Asset?

I have a catalog shop, and it has an input for an id number.
How can I tell if the id number entered is for a bundle or simply an asset?
Is there an api command or any way, other than…
Have specific inputs for bundle or asset, or try asset first, and if it fails, try bundle or vice versa?


MarketplaceService:GetProductInfo() allows you to check for informations of an asset on Roblox, it returns a dictionary of details. One of the details is AssetTypeId number, which means you can tell if the asset is a package.

local marketplaceService = game:GetService('MarketplaceService')
local productInfo = marketplaceService:GetProductInfo('YOUR ASSET ID')

-- package is bundle
if productInfo.AssetTypeId == Enum.AssetType.Package.Value then
    -- code
1 Like

Oh… I didn’t associate ‘Bundle’ with ‘Package’, thanks.