Hello, i was working on re using an old script for a fund raiser and i got an error and i dont know how to fix it
Error: attempt to perform arithmetic (add) on number and nil
local function processReceipt(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
local productId = receiptInfo.ProductId
local donationAmount = robuxDonationIDs[tostring(productId)]
if not player then
--The player probably left
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
local currencySpent = receiptInfo.CurrencySpent
game.ReplicatedStorage.RobuxRaised.Value = game.ReplicatedStorage.RobuxRaised.Value + donationAmount
print("donation detected")
RobuxRaisedDataStore.RaiseRobuxAmount(donationAmount)
print("Amount of Robux raised " .. RobuxRaisedDataStore.GetAsync())
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end