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:
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.
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.
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)
local productId = 91486130
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
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.
-- 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)