Advertisement
drakon-firestone

Untitled

Dec 1st, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. local MarketplaceService = game:GetService("MarketplaceService")
  2. local Players = game:GetService("Players")
  3.  
  4. local productFunctions = {}
  5.  
  6. productFunctions[TUTAJ_WSTAW_ID] = function(receipt, player)
  7. player.leaderstats.Diamonds.Value += 100000
  8. end
  9.  
  10. local function processReceipt(receiptInfo)
  11.  
  12. local userId = receiptInfo.PlayerId
  13. local productId = receiptInfo.ProductId
  14.  
  15. local player = Players:GetPlayerByUserId(userId)
  16.  
  17. if player then
  18. local handler = productFunctions[productId]
  19.  
  20. local succes, result = pcall(handler, receiptInfo, player)
  21.  
  22. if succes then
  23. return Enum.ProductPurchaseDecision.PurchaseGranted
  24. else
  25. warn("Failed to process receipt: ", receiptInfo, result)
  26. end
  27.  
  28. end
  29.  
  30. return Enum.ProductPurchaseDecision.NotProcessedYet
  31.  
  32. end
  33.  
  34. MarketplaceService.ProcessReceipt = processReceipt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement