Why is devproduct not working when i have more than 1 dev product in my game

So my first dev product is working then i added a new dev product but when i did the first product messed up and is doing the 2nd dev product functions everytime i bought it

first dev product script:
In local script inside an image button

local MPS = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local productId = 1105330914
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Up:Connect(function()
	if game.ReplicatedStorage.ProductStatus.FrogJumpBuyable.Value == true then
		MPS:PromptProductPurchase(player, productId)
	end
end)

in a script:

local MPS = game:GetService("MarketplaceService")

local players = game:GetService("Players")

local productID = 1105330914

local function processReceipt(receiptInfo)
	
	local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if player then
		game.ReplicatedStorage.ProductStatus.FrogJumpBuyable.Value = false
		local frogJumpClone = game.ServerStorage.FrogJump:Clone()
		frogJumpClone.Parent = game.ServerScriptService
		game.ReplicatedStorage.ServerMessage.FrogJumpBuyed:FireAllClients(player)
	end
	
end

MPS.ProcessReceipt = processReceipt

2nd Dev product:
in local script inside an image button:

local MPS = game:GetService("MarketplaceService")

local players = game:GetService("Players")

local productId = 1105625513

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Up:Connect(function()

if game.ReplicatedStorage.ProductStatus.JumpScareBuyable.Value == true then

MPS:PromptProductPurchase(player, productId)

end

end)

in script:

local MPS = game:GetService("MarketplaceService")

local players = game:GetService("Players")

local productID = 1105625513

local function processReceipt(receiptInfo)
	
	local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if player then
		game.ReplicatedStorage.ProductStatus.JumpScareBuyable.Value = false
		local JSServerHandlerClone = game.ServerStorage.JumpscareFirer:Clone()
		JSServerHandlerClone.Parent = game.ServerScriptService
		local JSActivatorClone = game.ServerStorage.JumpscareActivation:Clone()
		JSActivatorClone.Parent = game.StarterGui
		game.ReplicatedStorage.ServerMessage.JumpScareBuyed:FireAllClients(player)
	end
	
end

MPS.ProcessReceipt = processReceipt
1 Like

there can only be 1 ‘receipt handler’ at once, you need to handle both devproducts in 1 code

1 Like

All receipts should be handled in ONE script.

2 Likes