Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MarketplaceService = game:GetService("MarketplaceService")
- local Players = game:GetService("Players")
- local productFunctions = {}
- productFunctions[1538160020] = function(receipt, player)
- player.leaderstats.Diamonds.Value += 100000
- end
- local function processReceipt(receiptInfo)
- local userId = receiptInfo.PlayerId
- local productId = receiptInfo.ProductId
- local player = Players:GetPlayerByUserId(userId)
- if player then
- local handler = productFunctions[productId]
- local success, result = pcall(handler, receiptInfo, player)
- if success then
- return Enum.ProductPurchaseDecision.PurchaseGranted
- else
- warn("Failed to process receipt:", receiptInfo, result)
- end
- end
- return Enum.ProductPurchaseDecision.NotProcessedYet
- end
- MarketplaceService.ProcessReceipt = processReceipt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement