Adorations, Devforum members! I have a problem with the Donation Board in the cafe I’m developing at.
It seems to be adding the amount of robux a player has donated. For example, I donated 1k robux. And after a few minutes or hours, the amount will increase but I didn’t donate any more robux.
I tried to take a look at the dev console whenever it occurs, but I still don’t see any errors related to the DonoBoard.
Thanks alot and I hope everyone would have a phenomenal day ahead.
This is the DonoBoard MarketPlace script:
--// Services \\--
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
--// Variables \\--
local donationStore = DataStoreService:GetOrderedDataStore("PlayerDonations")
local purchaseHistoryStore = DataStoreService:GetDataStore("PurchaseHistory")
local Purchases = {
[179282023] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,5)
end;
[448564121] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,10)
end;
[179282392] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,50)
end;
[179282780] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,100)
end;
[448564643] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,500)
end;
[179283385] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,1000)
end;
[974080130] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,2500)
end;
[974081772] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,5000)
end;
[974081855] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,7500)
end;
[974081914] = function(receiptInfo)
donationStore:IncrementAsync(receiptInfo.PlayerId,10000)
end;
}
--// Main \\--
MarketPlaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
local purchased = false
local success, errorMessage = pcall(function()
purchased = purchaseHistoryStore:GetAsync(playerProductKey)
end)
if success and purchased then
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif not success then
error("Data store error:" .. errorMessage)
end
local Player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not Player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local Handler = Purchases[receiptInfo.ProductId]
local success, result = pcall(Handler, receiptInfo, Player)
if not success or not result then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local success, errorMessage = pcall(function()
purchaseHistoryStore:SetAsync(playerProductKey, true)
end)
if not success then
error("Cannot save purchase data: " .. errorMessage)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
[details="Summary"]
This text will be hidden
[/details]