My developer Products are not able to purchase

Hello, currently I am trying to make dev products for currency but whenever i try to test purchase them it shows this

here are the two scripts:
this is the ServerScript

local ProductToQuantity = {
	[2613977068] = 100, 
	[2613977030] = 250,
	[2636797427] = 500,
}

local function processReceipt(receiptInfo)
	
	local productId = receiptInfo.ProductId
	local quantity = ProductToQuantity[productId]
	
	local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
	
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

	if player then
		local Leaderstats = player:WaitForChild("leaderstats")
		local Leaderstat = Leaderstats:FindFirstChild("Time") -- Change Coins to whatever your currency is
		Leaderstat.Value = Leaderstat.Value + quantity
		
	end
	
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

game:GetService("MarketplaceService").ProcessReceipt = processReceipt

this is the client

local ShopChildren = script.Parent:GetChildren()

local MarketplaceService = game:GetService("MarketplaceService")

local player = game.Players.LocalPlayer

for _, button in pairs(ShopChildren) do
	if button:IsA("TextButton") or button:IsA("ImageButton") then
		button.MouseButton1Click:Connect(function()
			local gamePassID = button.DevID.Value
			MarketplaceService:PromptGamePassPurchase(player, gamePassID)
			
		end)
	end
end

basically im seeing which button is pressed with the product ID inside then the server sees which ID then it gives that currency

any help is appreciated!

bruh

change it to

MarketplaceService:PromptPurchase((player, gamePassID)

1 Like

actually it now turns out you need to put

MarketplaceService:PromptProductPurchase((player, gamePassID)

if not it will just tell u it not for sale!

2 Likes

i was on my phone :smiling_face_with_tear:

well atleast its fixed now soo

1 Like

yes, thanks anyway it was needed.

1 Like

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