MarketplaceService:Prompt(GamePass)Purchase: Invalid ID

I’m helping @TSTintenfische work on a game called Clone Crusaders. Whilst working on the gamepass shop, I came across a glitch/bug/problem with gamepasses. Here’s the details:

For all of the below, yes I am passing the player argument when calling PromptPurchase methods.

If you call PromptPurchase and supply the valid gamepass ID:
The prompt purchase dialog does pop up with the correct gamepass and lets you purchase it. However the server’s MarketplaceService.PromptPurchaseFinished event doesn’t fire.

If you call PromptGamePassPurchase and supply the valid gamepass ID:
The prompt purchase dialog pops up, but the first thing it says is that the purchase failed and the warning below appeared in the console.

PurchasePromptScript: getProductInfo failed because MarketplaceService:getProductInfo() failed because HTTP 0 (HTTP 400 (HTTP/1.1 400 BadRequest)) Make sure a valid ID was specified

Here’s the client sided code that’s used to prompt the purchase:

Speed.MouseButton1Click:connect(function()
    MarketplaceService:PromptGamePassPurchase(player, 1230866867)
end)

I tried creating a new gamepass (Health Potion - Roblox) and that one didn’t work either.

Since the server event hasn’t fired once in all of my trials, I’m going to omit it for brevity. If anyone has any information, PLEASE reply!

2 Likes

Roblox is weird with game passes atm - they released an update and rolled it back, but not completely.

Try seeing if PromptGamePassPurchaseFinished fires, as it’s the one designed to work with game passes.

Thank you, but that’s not working either. I tried both PromptGamePassPurchase with PromptGamePassPurchaseFinished and PromptPurchase with PromptGamePassPurchaseFinished but it’s still not working. Same results as the 2nd scenario.

Just tested it myself with both PromptPurchase versions and it worked.

Screenshot_653

:thinking:

Yes, it works in other games but not this game and I don’t know why.

So is this game the place the gamepass is assigned to?

Yes it is. It’s not in Experimental Mode either. Also in other games that aren’t in experimental mode, the PromptGamePassPurchaseFinished works on server side too, not just client side.

Weird. Maybe do a bug report? But then if it is only limited to one place, won’t be sure if it is your fault somehow or Roblox.

did you check your http settings

HTTP requests are already enabled if that’s what you mean.

you can try using :PromptPurchase() for now, this might be a studio bug

Similar Thread you can refer to: :PromptGamePassPurchase()

The problem isn’t getting the prompt to come up, it’s getting the prompt to come up (which PromptPurchase does) and also getting the server to acknowledge they bought the pass (which it doesn’t with both events)

this is what i used for my game and it works

local productId = 91486130
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)

Try settings a variable

I can guarantee that will not change anything. I doubt it’s a problem with the way the code is written, it’s most likely a problem with Roblox.

1 Like

Ah right I completely forgot about that change. How do I view the game pass’s pass id instead of the asset id?

That change has been rolled back.

Have you looked at this:

That should work for the gamepass.

These are disabled and cannot be used:

These are only for developer products:

I do want to also mention, I wouldn’t recommend using GamePassService/PlayerHasPass as it caches. You do not have to use GamePassService. I assume that is going to change with Update on Game Passes but as of now, you do not have to use GamePassService.

1 Like

Here you go:

-- Extra WalkSpeed Script
local marketplaceService = game:GetService("MarketplaceService")
local wspass = {id=1230866867,speed=25}

function changeWalkSpeed(player)
	repeat wait() until player.Character
	player.Character.Humanoid.WalkSpeed = wspass.speed
end

function checkGamepass(player)
	if marketplaceService:PlayerOwnsAsset(player, wspass.id) then
		changeWalkSpeed(player)
	end
end

game.Players.PlayerAdded:connect(function(player)
	checkGamepass(player)
	player.CharacterAdded:connect(function()
		checkGamepass(player)
	end)
end)

marketplaceService.PromptPurchaseFinished:connect(function(player,assetid,purchased)
	if assetid == wspass.id then
		if purchased then
			changeWalkSpeed(player)
		end
	end
end)
-- Extra WalkSpeed LocalScript
local player = game.Players.LocalPlayer
local marketplaceService = game:GetService("MarketplaceService")

script.Parent.MouseButton1Click:connect(function()
	marketplaceService:PromptPurchase(player, 1230866867)
end)

Those do work.

1 Like