Developer Products not received post-purchase, only works in studio play mode

  1. I want to be able to sell developer products, and i got to the point that it works in play mode, but not in local test / acutal game.

  2. As mentioned above, i receive the items in play mode, but not local test / acutal game. in play mode i get the error occured warn from line 34 of server script

  3. I have consulted a friend of mine and we spent some time looking at it, and it just doesnt work.

--SERVER SCRIPT

local MS = game:GetService("MarketplaceService")
local RS = game:GetService("ReplicatedStorage") -- holds buyables

local Products = {
	[1377321773] = function(receipt, player)
		RS.Buyables["Gravity Coil"]:Clone().Parent = player:WaitForChild("Backpack")
	end,
	[1377348243] = function(receipt, player)
		RS.Buyables.Balloon:Clone().Parent = player:WaitForChild("Backpack")
	end,
	[1377348296] = function(receipt, player)
		RS.Buyables.GrappleHook:Clone().Parent = player:WaitForChild("Backpack")
	end,
	[1377348977] = function(receipt, player)
		RS.Buyables.FlyingCarpet:Clone().Parent = player:WaitForChild("Backpack")
	end,

}

function processReceiptFunction(receiptinfo)
	local playerProductKey = receiptinfo.PlayerId..":"..receiptinfo.PurchaseId
	local plr = game:GetService("Players"):GetPlayerByUserId(receiptinfo.PlayerId)

	local handler
	for ProductId, func in pairs(Products) do
		if ProductId == receiptinfo.ProductId then
			handler = func
			break
		end
	end
	--NEW CODE
	local suc, result = pcall(handler, receiptinfo, plr)
	if not suc or not result then
		warn("error occured")
	end
	--END OF NEW CODE
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

MS.ProcessReceipt = processReceiptFunction

-- BUY PART SCRIPT

script.Parent.Triggered:Connect(function(player)
	if player then
		game:GetService("MarketplaceService"):PromptProductPurchase(player, 1377348243)
	end
end)

Maybe something like this could help you:

image
image

Local Script:

local marketplaceService = game:GetService("MarketplaceService")
local players = game:GetService("Players")

local player = players.LocalPlayer
local productId = 4230984029730 -- dev product id would go here, but i spammed 

script.Parent.MouseButton1Down:connect(function()
	marketplaceService:PromptProductPurchase(player, productId)
end)

Server Script:

local productFunctions = {}
local productId = 4230984029730 -- dev product id would go here, but i spammed my keyboard..

productFunctions[productId] = function(receipt, player)
	local stats = player:FindFirstChild("Stats")
	local currency = stats and stats:FindFirstChild("Coins")
	if player and currency then
		currency.Value += 50 -- code for rewarding the player would go here..
		return true -- indicated a successful purchase
	end
end

forced to use a server script for the buy part as its a prox prompt. does this affect it? also, it feels like the scripts I have shown are basically the same to yours.

Well yeah obviously, because I utlised code from the CreateRoblox…

bumppp where you able to fix yours yet? my other game had this bug and i redid all products

nope. sadly had to remove all items and come up with gamepass alternatives. Sorry :confused: