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

Why doesn't getting the Badge Icon Asset ID work?

Asked by 3 years ago
Edited 3 years ago

I'm editing a badge giver (not free model it is my own) and it is not giving the asset id. It is giving nil and not the asset id. Output:

10:14:23.447 - Image "https://assetdelivery.roblox.com/v1/asset?id=nil" failed to load in "Workspace.mini man.Decal.Texture": Request failed

Code (part of script):

local market = game:GetService("MarketplaceService")
script.Parent.Decal.Texture = "rbxassetid://" .. tostring(market:GetProductInfo(2124545182,0).ImageIconAssetId)

Thanks, b_mni

1 answer

Log in to vote
1
Answered by 3 years ago

https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo

IconImageAssetId is only supported for Developer Products and Game Passes.

BadgeService is the way to go to get the bade image id. https://developer.roblox.com/en-us/api-reference/function/BadgeService/GetBadgeInfoAsync

Ad

Answer this question