Hello. I’m attempting to use the MarketplaceService to retrieve the Icon/Image ID for a hat on the Avatar Shop to use in an ImageLabel.
However, when I attempt to retrieve the ID, it only returns a value of ‘0’. Other information such as the Name, Price in Robux, and Description can be retrieved flawlessly.
local mps = game:GetService("MarketplaceService")
while true do
local itemvalue = script.Parent.CurrentItem.Value
local item = mps:GetProductInfo(itemvalue)
--update icon
script.Parent.ItemIcon.Image = item.IconImageAssetId
wait(0.01)
end
I’ve tried getting the Icon ID by replacing the ‘itemvalue’ variable with the ID of the item manually, but this only resulted in the same problem. I’ve also tried using other hats.
For reference, the value of the ‘itemvalue’ variable is 1028606, and is in an integer format, not a string format. It should be returning an image of the Red Baseball Cap.