Hello! I want to know - how to get icon of gamepass without calling MarketplaceServcie:GetProductInfo() function? I don’t found any answers
Is there a specific reason why you would avoid using MarketplaceService:GetProductInfo()
?
- it takes time to load
- sometimes it can be ignored bcuz of too many requests
(i using player’s gamepass load system and it takes so many time to load all gamepasses with marketplace service)
It doesn’t appear there are any other ways. Just use some preloading methods… or don’t load them all at once but only when needed.
Maybe just wrap image load function in task.spawn()? It make gamepasses load faster
The too many request error appear very rarely so it dont will be huge problem
The only way that you can bypass the webcall would just be storing the link somewhere and grabbing it that way.
i.e:
local GamepassImages = {
MyGamepass = 123456
};
local Image = `rbxassetid://{GamepassImages.MyGamepass}`
It doesn’t work bcuz gamepass id is not asset id. So it will be load not gamepass icon
I’m saying just get the ID for the image and shove it into a table manually.
Just store this somewhere and run it when needed beforehand:
local MarketplaceService = game:GetService("MarketplaceService")
function GetGamepassImageId(GamepassId): number
local ImageId = MarketplaceService:GetProductInfo(GamepassId).IconImageAssetId
print(ImageId)
return ImageId
end
And then update your gamepassid table so that you dont have to do the webcall again.
Good idea but sorry, I don’t need for cache function now, but thanks. Maybe I’ll use it in future
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.