thngf

Untitled

Oct 2nd, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. -- SUPER RADIO CONFIG
  2.  
  3. -- Make sure you put this script in game.ServerScriptService
  4.  
  5. local DEFAULT_SONG = 198289443 -- The ID of the default song that plays when no radio is set
  6.  
  7. local NATURE_SOUNDS = true -- By default Super Radio comes with some chill nature sounds.
  8.  
  9. local ANNOUNCE_RADIO = true -- Announce via hint whenever a user changes the song on the radio?
  10.  
  11. local PRODUCT_ID = 27695909 -- Set this to the id of the product you want players to buy to activate radio.
  12. -- You can make developer products your place's config page. (PRODUCT MUST BE IN SAME GAME TO WORK!)
  13.  
  14. local PROCESS_RECEIPT = true -- Set this to true ONLY IF YOU DON'T HAVE ANOTHER SCRIPT THAT PROCESSES
  15. -- PRODUCT PURCHASES. ONLY ONE SCRIPT CAN PROCESS PURCHASES PER GAME. Setting this to true means you
  16. -- don't have any other developer products in your game and you want this script to handle purchases.
  17.  
  18. -- If PROCESS_RECEIPT is set as false, integrate the radio into your purchase handler script like this:
  19.  
  20. --[[
  21.  
  22. function getPlayerFromId(id)
  23. for i,v in pairs(game.Players:GetPlayers()) do
  24. if v.userId == id then
  25. return v
  26. end
  27. end
  28. end
  29.  
  30. game.MarketplaceService.ProcessReceipt = function(receiptInfo)
  31. local player = getPlayerFromId(receiptInfo.PlayerId)
  32. if player ~= nil then
  33. if receiptInfo.ProductId == PRODUCT_ID then -- radio
  34. game.ServerStorage.ChangeRadio:Invoke(player)
  35. end
  36. end
  37. return Enum.ProductPurchaseDecision.PurchaseGranted
  38. end
  39.  
  40. --]]
  41.  
  42. -- (Make sure you auctually manually set what PRODUCT_ID is if you copy the above code)
  43.  
  44. -- Don't touch this or nothing will work at all
  45.  
  46. require(402795746)(DEFAULT_SONG,NATURE_SOUNDS,ANNOUNCE_RADIO,PRODUCT_ID,PROCESS_RECEIPT)
Advertisement
Add Comment
Please, Sign In to add comment