MarketplaceService:Prompt(GamePass)Purchase: Invalid ID

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

There could be studio glitches since they rolled back

The wiki hasn’t been updated since the change was rolled back. There are no glitches about this topic in studio.

For some reason it just randomly started working whenever Tinten opened the game in studio this morning :confused:

If I’m not mistaken, gamepass calls can be made no matter what your HTTP call settings are.


Additionally, I’ve just testing my gamepass calls and they seem to be working completely fine. I think the best step would be to try and identify any abnormalities in this place by comparison to your other places.

EDIT:

That’s good, was anything changed from when it was broken to now?

I do want to mention that it wasn’t randomly as what Encoded said. The code was comparing a string to an integer which is why it didn’t work. I have contacts to Tinten (Encoded was offline at the time). It must’ve been skipped over. That was the problem basically.

Tinten must’ve not told Encoded about it yet.