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[TUTAJ_WSTAW_ID] = 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 succes, result = pcall(handler, receiptInfo, player)
- if succes 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