Need help with Gamepass IDs

Hi there! This is a script I have for a gamepass / shop panel of a Menu GUI. When I try to input Gamepass IDs, they do not work and I believe it is because of scripting updates that were made a while ago. However, I do not script and am not sure how to fix this.

These are the IDs I am trying to work with:

6126802
6126798
6126793
6126776


local CurrentSelected = nil
local Open = false
for _,v in pairs(script.Parent.ScrollingFrame:GetChildren()) do
	do
		if v.ClassName == "TextButton" then
			do
				v.MouseButton1Click:connect(function()	
	CurrentSelected = v
	for _,v in pairs(script.Parent.ScrollingFrame:GetChildren()) do
		if v.ClassName == "TextButton" then
		end
	end
	local Asset = game:GetService("MarketplaceService"):GetProductInfo(v.Id.Value)
	script.Parent.Info.TipsText.Text = Asset.Name
	script.Parent.Info.TheText.Text = Asset.Description
end)
				v.MouseEnter:connect(function()	
	if v == CurrentSelected then
		local hi = true
	else
		do
		end
	end
end)
				v.MouseLeave:connect(function()	
	if v == CurrentSelected then
		local hi = true
	else
		do
		end
	end
end)
				-- DECOMPILER ERROR at PC27: LeaveBlock: unexpected jumping out IF_THEN_STMT

				-- DECOMPILER ERROR at PC27: LeaveBlock: unexpected jumping out IF_STMT

			end
		end
	end
end
script.Parent.Purchase.MouseButton1Click:connect(function()	
	if CurrentSelected then
		game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, CurrentSelected.Id.Value)
	end
end)

Thanks in advance!

Yeah you are right, well MarketPlaceService changed a little. I thnik ProcessReceipt is new, you sohuld check it out.

1 Like

ProcessReceipt is not new, it has been the standard for processing developer product purchases since their inception. It also has nothing to do with game passes.

Oh I am sorry I miss understood his question. Going to edit or delete.

You should fix your code formatting, it looks extremely messy. This may be part of the reason as to why you’re unable to find the source of error. Good code readability makes it easier to find issues. You should also apply some basic debugging and read the API pages before creating threads: a quick search would help you resolve your problems.

When working with GetProductInfo for game passes, you must pass Enum.InfoType.GamePass as the second argument. As for purchasing them, you are required to use PromptGamePassPurchase.

Game passes use a different asset id system to the catalog. They’re under the directory game-pass, so you would need to access them through https://www.roblox.com/game-pass/id.

1 Like