You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve?
A dev product that actually works!
- What is the issue?
The issue is when you buy the dev product it doesn’t add the value to the donations!
- What solutions have you tried so far?
Finding a solution!
local MarketplaceService = game:GetService("MarketplaceService")
local DataStoreService = game:GetService("DataStoreService")
local PreviousPurchases = DataStoreService:GetDataStore("PreviousPurcchasesV1")
local givedonationrobux = 1197427516
MarketplaceService.ProcessReceipt = function(receipt)
local ID = receipt.PlayerId.."-"..receipt.PurchaseId
local success = nil
pcall(function()
success = PreviousPurchases:GetAsync(ID)
end)
if success then
return Enum.ProductPurchaseDecision.PurchaseGranted
end
local player = game.Players:GetPlayerByUserId(receipt.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
else
if receipt.ProductId == givedonationrobux then
player["R$ Donated"].Value = player["R$ Donated"].Value + 5
end
pcall(function()
PreviousPurchases:SetAsync(ID,true)
end)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
Thank you in advance!