Developer Product script always causes prompt to fail?

I’m trying to add developer products into my game, and it doesn’t work, seeing as although the prompt works, the developer product prompt always fails. I know it isn’t ROBLOX Studio issues as I tried in roblox and the same thing occured. Help much appreciated:

Code:

local MarketplaceService = game:GetService("MarketplaceService")
local ProductId = 1339191757
function MarketplaceService.ProcessReceipt(ReceiptInfo)
	local Player = game:GetService("Players"):GetPlayerByUserId(ReceiptInfo.PlayerId)
	if not Player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

	if ReceiptInfo.ProductId == ProductId then
		Player:WaitForChild("SpleefCoins").Value += 500
		return Enum.ProductPurchaseDecision.PurchaseGranted
	elseif ReceiptInfo.ProductId == 1339221667 then
		print(Player.Name.." Donated!")
		return Enum.ProductPurchaseDecision.PurchaseGranted
	else
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
end


Meanwhile, I’ll double check the id’s and everything

1 Like

Is it a third party sale? (Chars)

1 Like

It’s made by my group, which I own

1 Like

Is it made under the group name?

EDIT: Is the game which is having this problem made under the group name.

2 Likes

Yes, it’s all done to my group

1 Like

I have a gamepass handler which seems to work, even though the gamepass is under the group. Maybe my scripting implementation is the issue

Is there two processreceipt scripts? If so this will be the problem

Er yeah. I have a game pass handler and a dev product handler

You should use the MarketplaceService.PromptGamePassFinished event for handling game passes. The MarketplaceService.ProcessReceipt callback is only for developer products.

It’s fine, I found the issue. Silly of me to type in the wrong id.