Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. --[[This script goes inside of a TextBox which should be inside of a ScreenGui]]
  2. productId = 25299632 -- Replace 123123123 with the id of your developer product.
  3. local DataStore = game:GetService("DataStoreService"):GetDataStore("clams")
  4. local MarketplaceService = Game:GetService("MarketplaceService")
  5. function UsernameFromID(ID)
  6. if type(ID) ~= "number" then
  7. return
  8. end
  9. local sets = game:service("InsertService"):GetUserSets(ID)
  10. for k, v in next, sets do
  11. if v.Name == "My Models" then
  12. return v.CreatorName
  13. end
  14. end
  15. end
  16. function giveRewards(player)
  17. local plyr = script.Parent.Parent.Parent.Parent
  18. plyr:WaitForChild("Clams")
  19. plyr.Clams.Value = plyr.Clams.Value + 50
  20. plyr.PlayerGui.AllahAkbar.Allah.Text = tostring(plyr.Clams.Value)
  21. local key = "user_" .. plyr.userId
  22. DataStore:SetAsync(key, plyr.Clams.Value)
  23. return Enum.ProductPurcaseDecision.PurchaseGranted
  24. end
  25. MarketplaceService.ProcessReceipt = function(receiptInfo)
  26. giveRewards(UsernameFromID(receiptInfo.PlayerId))
  27. end
  28. script.Parent.MouseButton1Down:connect(function()
  29. Game:GetService("MarketplaceService"):PromptProductPurchase(script.Parent.Parent.Parent.Parent, productId)
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement