How can I do this?

So I was wondering how I can get a gamepass based on its ID and then see the price of it and the owner of it, how can I do that?

1 Like

The player who owns the gamepass, or who created the gamepass?

that’s how you get the game pass, but i don’t know how to get the name of it.

local GamepassId = ... -- enter your id
local MPS = game:GetService("MarketplaceService")

local Gamepass  = MPS:GetProductInfo(GamepassId, Enum.InfoType.GamePass)
2 Likes

GetProductInfo returns a dictionary, with the gamepass name included

1 Like
local MarketplaceService = game:GetService("MarketplaceService")


local assetId = rbxassetid://

local function displayAssetInfo()
    local success, info = pcall(function()
        return MarketplaceService:GetProductInfo(assetId, Enum.InfoType.Asset)
    end)

    if success and info then
      script.parent.parent.Textlabel1.Text = tostring(info.Name)
       script.Parent.Parent.Textlabel2.Text = tostring(info.PriceInRobux)
        

        local iconImageId = "rbxassetid://" .. info.IconImageAssetId
script.Parent.Parent.ImageLabel.Image = iconImageId
      
      
   
    end
end
1 Like

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