How can I get a gamepass name with its ID?

I want to print out the gamepasses name whenever it has been bought. I don’t think sharing my code is necessary. I just want the gamepasses name via using the ID (or another way if possible).

This should work just put the passid where the 000 is.

local MarketplaceService = game:GetService("MarketplaceService")

local Success, Info = pcall(function()
return MarketplaceService:GetProductInfo(000, Enum.InfoType.GamePass)
end)	
if Success and Info.Name then
print(Info.Name)
end

I thought that wouldn’t work because it says GetProductInfo. Thanks.

1 Like

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