Developer Product Script Not Working

Hello Developers,

I am trying to create an obby with a skip stage feature. When the player presses the button on screen It will prompt them to purchase a developer product that allows them to skip the stage. I have a local script under my text button.

image

Local Script:

script.Parent.MouseButton1Down:Connect(function()
	local marketplaceservice = game:GetService("MarketplaceService")
	marketplaceservice:PromptPurchase(game.Players.LocalPlayer, 1279660651)
end)

I also have another script in ServerScriptService

image

local marketplaceservice = game:GetService("MarketplaceService")

marketplaceservice.ProcessReceipt = function(receiptInfo)
	local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if receiptInfo.ProductID == 1279660651 then
		player.leaderstats.Stage.Value +=1 
		wait(1)
		player:LoadCharacter()
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

I am trying to make it so that when the player purchases it there Stage value will increase by 1 and reset their character so that they spawn at the next checkpoint.

However there is this issue that when I propmpt the purchase an error appears

image

I am not sure why this error is popping up.
image

As far as I am aware there is no way to put a developer product on sale.

If you paster the id of the developer product into the roblox url bar then this item appears: https://www.roblox.com/library/1279660651/SolidModel

This item is offsale and I am not sure if my script is trying to sell that item instead of mine.

I am not sure how I can fix this.

Any help is apreciated :smiley:

hmm do u have third party sales on?

For products, you have to use PromptProductPurchase instead.

1 Like

Yeah you are right if im not wrong marketplace service handles the reciepts?

Yep, you’re right.


1 Like

Thanks it works now!

image

1 Like