If you need further explanation, feel free to ask

local MS = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local function processRecipt (receiptInfo)
	local plr = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not plr then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	if plr then
		print(receiptInfo.CurrencySpent)
		print(receiptInfo.CurrencySpent)
		game.Players:GetPlayerByUserId(receiptInfo.PlayerId):FindFirstChild("leaderstats").Donation.Value = game.Players:GetPlayerByUserId(receiptInfo.PlayerId):FindFirstChild("leaderstats").Donation.Value + receiptInfo.CurrencySpent  
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

MS.ProcessReceipt = processRecipt()

2 comments

0

Is receiptInfo a table? If so, use receiptInfo["Value"]

1

Also maybe this will help, first check the output for an error which will be in red. Post the error and I can explain it. If there are no errors, between every line, type print("Mark") then go into the output and figure out which time "Mark" was not printed. That means that the line above has a bug.