How to get a gamepass info in script?

Hi,
I have a gamepass shop and i don’t want to put text by myself i want it be automatically, so i want to use GetProductInfo but when i try to get info about product it returns like its a game. My gamepass called “gravity coil” but it shows in gui that its princesses place (its checks not a gamepass,but a game!) heres my script:

local id = script.Parent.Parent.IDs:FindFirstChild(script.Parent.Name).Value
local Asset = game:GetService("MarketplaceService"):GetProductInfo(id)
script.Parent.Icon.Image = "rbxassetid://"..Asset.IconImageAssetId
script.Parent.Title.Text = Asset.Name
script.Parent.Price.Text = tostring(Asset.PriceInRobux)

Why this checks a place that have the same id like my gamepass? how to fix it?

Replace
game:GetService("MarketplaceService"):GetProductInfo(id)

With
game:GetService("MarketplaceService"):GetProductInfo(id,Enum.InfoType.Asset)

3 Likes

Isn’t it gonna be game:GetService("MarketplaceService"):GetProductInfo(id, Enum.InfoType.GamePass)?