I know you can convert CatalogID to AssetID using InsertService, but I was wondering if you could do it the other way around? Trying to fetch the price of a shirt from just the AssetID.
you could use :GetProductInfo
Code example:
local MS = game:GetService("MarketplaceService")
local AssetId = 174750655
local ProductInfo = MS:GetProductInfo(AssetId)
print(ProductInfo.PriceInRobux)
I thought of this, however when applied to a Shirt instance the AssetID or CatalogID is converted to a TextureID for the shirt texture itself.
print(mps:GetProductInfo(5809687545))
returns
{
["AssetId"] = 5809687545,
["AssetTypeId"] = 11,
["ContentRatingTypeId"] = 0,
["Created"] = "2020-10-10T01:23:54.197Z",
["Creator"] = ▶ {...},
["Description"] = "cute pants to match: https://www.roblox.com/catalog/7507676338/cute-halloween-pumpkin-set-pants-spooky-boo-ghost",
["IconImageAssetId"] = 0,
["IsForSale"] = true,
["IsLimited"] = false,
["IsLimitedUnique"] = false,
["IsNew"] = false,
["IsPublicDomain"] = false,
["MinimumMembershipLevel"] = 0,
["Name"] = "🦇🎃halloween bloody cardigan boo vintage vamp y2k",
["PriceInRobux"] = 8,
["ProductId"] = 1105245797,
["ProductType"] = "User Product",
["Sales"] = 0,
["TargetId"] = 5809687545,
["Updated"] = "2021-10-11T15:06:26.277Z"
}
However,
print(mps:GetProductInfo(script.Clothing.ShirtTemplate:sub(33)))
(The same shirt, but on an Instance)
returns
{
["AssetId"] = 5809687517,
["AssetTypeId"] = 1,
["ContentRatingTypeId"] = 0,
["Created"] = "2020-10-10T01:23:53.727Z",
["Creator"] = ▶ {...},
["Description"] = "Shirt Image",
["IconImageAssetId"] = 0,
["IsForSale"] = false,
["IsLimited"] = false,
["IsLimitedUnique"] = false,
["IsNew"] = false,
["IsPublicDomain"] = false,
["MinimumMembershipLevel"] = 0,
["Name"] = "bloody cardigan short sleeve",
["ProductId"] = 0,
["Sales"] = 0,
["TargetId"] = 0,
["Updated"] = "2020-10-10T01:23:53.77Z"
}