Get game information from game id

So im trying to get game information using marketplaceService but how do i make sure its always a gameid, not a image id, or something else, is there a way to filter so i only get gameid’s?

This is the code im using:

local market = game:GetService("MarketplaceService")
local info = market:GetProductInfo(GAME_ID)

print(info.Creator)
print(info.IconImageAssetId)

When i insert a id thats not a game the iconimageAssetId returns 0

1 Like

Use PlaceId instead.

local market = game:GetService("MarketplaceService")
local info = market:GetProductInfo(game.PlaceId)

print(info.Creator)
print(info.IconImageAssetId)

ok, so I’m making the id’s from math.Random(), is there a way to check before doing the function if the id is a PlaceId?

I think PlaceId will always get it right, I have tried multiple times and it worked for me.

alright thank you, ill try it out!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.