Bug with DEV Products

So I have a script that can do skip a stage but just recently out of no where it only works sometimes and sometimes not and also different ones to like 5x stage skips and 10x stage skips
heres an example:


the first stage is stage 1 btw so it just didnt work
5x skips was working now not and now 10x skips works??
I dont know if its a studio bug or a bug in my script but I dont think I have a bug

script for 1 skip

local marketPlaceService = game:GetService("MarketplaceService")

marketPlaceService.ProcessReceipt = function(receiptInfo)
	local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

	if receiptInfo.ProductId == 1315732683 then
		player.leaderstats.Stage.Value += 1
		wait(1)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

script for the button

script.Parent.MouseButton1Down:Connect(function()
	local marketPlaceService = game:GetService("MarketplaceService")
	marketPlaceService:PromptProductPurchase(game.Players.LocalPlayer, 1315732683)

end)
script for the 5 skips for reference

local marketPlaceService = game:GetService("MarketplaceService")

marketPlaceService.ProcessReceipt = function(receiptInfo)
	local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

	if receiptInfo.ProductId == 1315760164 then
		player.leaderstats.Stage.Value += 5
		wait(1)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

and the other one

script.Parent.MouseButton1Down:Connect(function()
	local marketPlaceService = game:GetService("MarketplaceService")
	marketPlaceService:PromptProductPurchase(game.Players.LocalPlayer, 1315760164)

end)

It’s hard for my to identify the problem as the problem just keeps changing so I think it could a studio bug or a cooldown for the buying dev product testing

You’re using different ProcessReceipts for each product, which will lead to only one of them working.

i need urgent help hence the bump so early plus I wasnt sure which one it went in sorry

I’m a little confused. What could I do to fix the problem

also im not really sure what you mean you didnt really explain that much more info would be greatly appreciated thanks.

You should have all of your code inside of a single ProcessReceipt. Having multiple would overwrite the others, leading to only one of them working. Ex:

local marketPlaceService = game:GetService("MarketplaceService")

marketPlaceService.ProcessReceipt = function(receiptInfo)
	local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if not player then return Enum.ProductPurchaseDecision.NotProcessedYet end
	
	if receiptInfo.ProductId == 1315732683 then
		player.leaderstats.Stage.Value += 1
		wait(1)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
	elseif receiptInfo.ProductId == 1315760164 then
		player.leaderstats.Stage.Value += 5
		wait(1)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
	
	return Enum.ProductPurchaseDecision.NotProcessedYet
end
3 Likes