Gamepass Icon via Script (Without Uploading Decals)

I have no idea who to ask so I'll just mention a few people
@DevRelationsTeam @Roblox_Staff

If New Gamepasses doesn’t have an Asset ID then how does this work now?

ImageLable.Image = 'https://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId='..AssetId

And It’s is a little bit complicated

https://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/GetProductInfo

GetProductInfo().IconImageAssetId

Does not work for Assets, ONLY DevProducts
From The Wiki “The AssetId of the asset’s icon if it is a developer product, returns 0 otherwise.”

I had to mention this because some thought that it works with Asset IDs, including me at first.

If the New Gamepasses does not have an Asset ID, then how can we display the Gamepass Image without uploading it as a decal?


And the Second Problem, How do you get the Asset ID of Old Gamepasses?

Well this method does not work right now Which is why I had to ask)

https://www.roblox.com/game-pass/12345/myGamePass
&
https://www.roblox.com/library/1044540653/myGamePass

They aren’t the same Item, which proves my point that it does not work atm.

2 Likes

It should work for assets if you do this:

local DevInfo = game:GetService("MarketplaceService"):GetProductInfo(v.ProductId, Enum.InfoType.Asset)	

print(DevInfo.Name)
print(DevInfo.IconImageAssetId)

For your second question, all old gamepass ids have been updated.

3 Likes

In short: Your method does not work and it didn’t answer any of my questions.


My 2nd Question is

For the second part, they were never stated to be the same thing. The ‘12345’ one was probably just a filler ID.

Old ID: https://www.roblox.com/library/1044540653/myGamePass
New ID: https://www.roblox.com/game-pass/3147328/myGamePass

So I dunno. I personally didn’t have any trouble getting the new IDs a few days ago.

As for getting the image of a gamepass icon based on its gamepass ID, um…you could try searching through the CoreScript for the purchase. But I wouldn’t know where to look exactly. I browsed, but couldn’t figure it out.

Yeah I have thought of doing that too but I doubt it would work correctly because the new Gamepasses don’t show the correct images atm

Stated Here

Oh, in that case I’m pretty sure there is no option to set Gamepass Icons via script. Will have to wait for them to fix it (even though it should have been fixed over a week ago)

1 Like