Failed to process receipt | attempt to call a nil value

ms.ProcessReceipt = function(receiptInfo)

	local productID = receiptInfo.ProductId
	local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

	if player then

		local handler = productFunctions[productID]
		local success, result = pcall(handler, receiptInfo, player)
		if success then
			print("pass")
			if productID == 1335381123 then
				raidStart()
			end
			return Enum.ProductPurchaseDecision.PurchaseGranted
		else
			warn("Failed to process receipt:", receiptInfo, result)
		end
	end
end

Can someone tell me why this returns an error saying “attempt to call a nil value”? Thanks in advance

Are you sure that handler exists? Can you show your productFunctions?

god im stupid i removed it earlier today and completely forgot about it, thanks for the help :skull:

Don’t forget to mark the solution!