Why aren't dev products working?

Hello all,

I have this CoinsProductHandler script which is in ServerScriptService:

local MarketplaceService = game:GetService("MarketplaceService")

local DataStoreService = game:GetService("DataStoreService")


local currencyName = "Coins"


local PreviousPurchcases = DataStoreService:GetDataStore("PreviousPurchases")

local ONE_HUNDRED_COINS = 1308971603

local Five_HUNDRED_COINS = 1308973428 	

local THREE_HUNDRED_COINS = 1308973327 	

local ONE_THOUSAND_COINS = 1308973549 

MarketplaceService.ProcessReceipt = function(receipt)


	local ID = receipt.PlayerId.."-"..receipt.PurchaseId

	local success = nil

	pcall (function()

		success = PreviousPurchcases:GetAsync(ID)
	end)


	if success then



		return Enum.ProductPurchaseDecision.PurchaseGranted

	end



	local player = game.Players:GetPlayerByUserId(receipt.PlayerId)


	if not player then


		return Enum.ProductPurchaseDecision.NotProcessedYet


	else		

		if receipt.ProductId == ONE_HUNDRED_COINS then
			player.leaderstats[currencyName].Value = player.leaderstats[currencyName].Value + 100
		end

		if receipt.ProductId == Five_HUNDRED_COINS then
			player.leaderstats[currencyName].Value = player.leaderstats[currencyName].Value + 500
		end
		
		if receipt.ProductId == THREE_HUNDRED_COINS then
			player.leaderstats[currencyName].Value = player.leaderstats[currencyName].Value + 300
		end
		
		if receipt.ProductId == ONE_THOUSAND_COINS then
			player.leaderstats[currencyName].Value = player.leaderstats[currencyName].Value + 1000
		end

		pcall(function()
			PreviousPurchcases:SetAsync(ID,true)
		end)
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

And in each coins box I have this LocalScript:
image

image

local MarketPlaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
	MarketPlaceService:PromptProductPurchase(player,1299653433)
end)

and when players try to buy the dev product this error appears:
image

Nothing appears in output/dev console ingame.

What’s wrong? How can I fix?

Thanks in advance!

Did you make sure you have this turned on?

It was that simple…
Thank you!

1 Like