Advertisement
vendaskOfficial

DevProductSystem

Dec 15th, 2018
1,706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. --will make a subseries video on how to add multiple devproducts
  2. local MarketplaceService = game:GetService("MarketplaceService")
  3.  
  4. local function processReceipt(receiptInfo)
  5.     local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
  6.     if not player then
  7.         return Enum.ProductPurchaseDecision.NotProcessedYet
  8.     end
  9.    
  10.     player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 1000
  11.     print(receiptInfo.PlayerId.. " just bought " .. receiptInfo.ProductId)
  12.    
  13.     return Enum.ProductPurchaseDecision.PurchaseGranted
  14. end
  15.  
  16. MarketplaceService.ProcessReceipt = processReceipt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement