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

How do I display a Gamepass Image? My script is displaying a model image instead...

Asked by 4 years ago
p.GamepassImage.Image = "http://www.roblox.com/Thumbs/Asset.ashx?Width=420&Height=420&AssetID="..tostring(perk.ID)

I'm trying to display my gamepass image with my gamepass id, however it is displaying a totally different thing (free model image)

I think it's because roblox gamepass id were changed, any help please?

2 answers

Log in to vote
1
Answered by 4 years ago

You can use MarketplaceService:GetProductInfo(ID,2).IconImageAssetId. This will get the icon of the Gamepass

local market = game:GetService("MarketplaceService")
p.GamepassImage.Image = "rbxassetid://" .. market:GetProductInfo(ID,2).IconImageAssetId

Happy to help, b_mni

0
Thanks, with your help I made p.GamepassImage.Image = "rbxthumb://type=GamePass&id="..tostring(perk.ID).."&w=150&h=150" and it worked! itadakimasu_Kurepu 29 — 4y
0
ok thanks :) User#29913 36 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

I think you only can do that with decals. What I would do is upload the decal and then get it from there.

Answer this question