I've been getting this error whenever I try to purchase a Dev Product

"attempt to index local 'receiptInfo' (a nil value)" on line 9

Script In ServerScriptService

local MPS = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local Fries = RS:WaitForChild("Fries")
local productID = 949968105

local function processReceipt(receiptInfo)
	
	local player = players:GetPlayedByUserID(receiptInfo.PlayerId)
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	if player then
		local char = game.Workspace:FindFirstChild(player.Name)
		local FriesClone = Fries:Clone()
		FriesClone.Name = "Fries"
		FriesClone.Parent = char
	end
	
	return Enum.ProductPurchaseDecision.PurchaseGranted
	
	
end

MPS.ProcessReceipt = processReceipt()

2 comments

0

I'm not sure but i think you forgot to put the receiptinfo argument when you ran the function on line 26 or you just were making a variable with it.

0

Ah Fixed it