Purchase failed error when playtesting

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Gamepass bought without error

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that when i click buy it gives purchase failed error

  3. What solutions have you tried so far?
    I have tried checking the gamepass id and changing my scripts

I have used 2 scripts

local Button = SG.OpenShopButton
local Frame = SG.MainFrame
local GamepassID1 = 1200373704 
local player = game:GetService("Players").LocalPlayer
wait(0.3)

Button.MouseButton1Click:Connect(function()
Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0))

end)
Frame.TextButton.MouseButton1Click:Connect(function()
	Frame:TweenPosition(UDim2.new(0.5, 0, -0.5, 0))
end)
Frame.ScrollingFrame.Gamepass1.BuyButton.MouseButton1Click:Connect(function()
	game:GetService("MarketplaceService"):PromptGamePassPurchase(player, GamepassID1)
end)

The Other is

local SG = script.Parent
local Button = SG.OpenShopButton
local Frame = SG.MainFrame
local GamepassID1 = 1200373704 
local player = game:GetService("Players").LocalPlayer
wait(0.3)

Button.MouseButton1Click:Connect(function()
Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0))

end)
Frame.TextButton.MouseButton1Click:Connect(function()
	Frame:TweenPosition(UDim2.new(0.5, 0, -0.5, 0))
end)
Frame.ScrollingFrame.Gamepass1.BuyButton.MouseButton1Click:Connect(function()
	game:GetService("MarketplaceService"):PromptGamePassPurchase(player, GamepassID1)
end)

Did you allow Third Party Sales in Home > Game Settings > Security?

1 Like

Yes i just changed it but it still doesnt work and the gamepass isnt third party

It appears your ID is wrong.
I could not find your ID as existing,
It appears you have an additional 2 digits on your gamepass ID, please make sure that that is absolutely the correct id, your code will work. Granted the wait(0.3) could be removed

1 Like

Thanks. I just have one more question.
It says i already own the gamepass so how could i test it

Buy it in studio, studio should allow you to buy it again.