SHARE
TWEET

Dev Products example

a guest Mar 1st, 2014 477 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local buyButton = script.Parent.Button.Button
  2. local productId = ID
  3. local Plr = script.Parent.Parent
  4.  
  5. buyButton.MouseButton1Click:connect(function()
  6.         Game:GetService("MarketplaceService"):PromptProductPurchase(Plr, productId)
  7. end)
  8.  
  9. local MarketplaceService = Game:GetService("MarketplaceService")
  10.  
  11. MarketplaceService.PromptProductPurchaseFinished:connect(function(userId, productId, isPurchased)
  12. if isPurchased then
  13. --What happens after purchase
  14. end
  15. end)
  16.  
  17. local buyButton2 = script.Parent.Button2.Button
  18. local productId2 = ID
  19.  
  20. buyButton2.MouseButton1Click:connect(function()
  21.         Game:GetService("MarketplaceService"):PromptProductPurchase(Plr, productId2)
  22. end)
  23.  
  24. MarketplaceService.PromptProductPurchaseFinished:connect(function(userId, productId2, isPurchased2)
  25. if isPurchased2 then
  26. --What happens after purchase
  27. end
  28. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top