Multiple purchase pass isn't working

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

  1. What do you want to achieve? Keep it simple and clear!
    When a player clicks on the purchase button to buy more in-game money, the gamepass prompt shows and they’re able to buy the money.

  2. What is the issue? Include screenshots / videos if possible!
    When clicking on the button, it says that an error claiming that the purchase failed because something went wrong.
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve been following many tutorials for this and all of them have given me the same error. I was just hoping that someone was able to help me out so I can finish this part of my game.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

This is the script inside of the purchase button:

MPS = game:GetService("MarketplaceService")
id = 270635080
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	MPS:PromptProductPurchase(player, id)
end)

This is the script inside of ServerScriptService

local MPS = game:GetService("MarketplaceService")

MPS.ProcessReceipt = function(receiptInfo)
	if receiptInfo.ProductId == 270635080 then
		local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
		player.leaderstats.Pounds.Value = player.leaderstats.Pounds.Value + 100000
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

Thank you.

2 Likes

You should use a developer product when selling things like extra cash, since you can buy it multiple times. You can only purchase a gamepass once.

Try sending a remoteevent to the server and prompting the purchase from there

Use developer products if you want your players to be able to buy it multiple times, game passes only let you buy them once

Ah, alright. I’ve give this a try. Thank you both!

1 Like

no problem, have a nice day further and succes!

Make sure to read what the previous replies have suggested before replying… thanks (:

(it seems we had the same suggestion about gamepasses)

ye I know but I didn’t saw it when I was writing, I was in a hurry

I don’t know much about remoteevents etc. How would I do this?

I’m also still getting the same error message, even though I’ve changed it to a developer product.

did you try this in Roblox Studio or just in the game it self?

I tried buying it in Roblox studio. It should come up saying that it’s a test purchase and my account won’t be charged.

is the developer product on sale? and check if the ID is correct

It’s on sale. For some reason, it copied the wrong ID. It’s working now. Thank you both!

1 Like

no problem, I am happy to hear that it worked. Have a nice day.

if there are more problems please let me know.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.