Advertisement
Walterin0

Untitled

Mar 11th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. --SynapseX Decompiler
  2.  
  3. local replicatedstorage = game:GetService("ReplicatedStorage")
  4. local players = game:GetService("Players")
  5. local lPlayer = players.LocalPlayer
  6. local cGUI = lPlayer:WaitForChild("PlayerGui"):WaitForChild("SongGUI")
  7. local dj_jones = 37158286
  8. local isNumber = function(str)
  9. return tonumber(str) ~= nil
  10. end
  11. script:WaitForChild("DJBoard").Adornee = workspace:WaitForChild("DJ_BOARD")
  12. script.DJBoard.PlayBtn.MouseButton1Down:connect(function()
  13. cGUI.CoreFrame.Visible = true
  14. end)
  15. cGUI:WaitForChild("CoreFrame"):WaitForChild("CoreTag"):WaitForChild("CancelBtn").MouseButton1Down:connect(function()
  16. cGUI.CoreFrame.Visible = false
  17. end)
  18. local marketplace = game:GetService("MarketplaceService")
  19. local function verifyUserInput(assetID)
  20. local userSuccess, userMessage = pcall(function()
  21. local isNumber = function(str)
  22. return tonumber(str) ~= nil
  23. end
  24. if isNumber(assetID) then
  25. if marketplace:GetProductInfo(assetID).AssetTypeId == 3 then
  26. return true
  27. else
  28. return false
  29. end
  30. else
  31. return false
  32. end
  33. end)
  34. if userSuccess then
  35. if userMessage then
  36. return true
  37. else
  38. return false
  39. end
  40. else
  41. return false
  42. end
  43. end
  44. cGUI.CoreFrame.CoreTag.OKBtn.MouseButton1Down:connect(function()
  45. if verifyUserInput(cGUI.CoreFrame.CoreTag.PasteIDBtn.Text) then
  46. cGUI.CoreFrame.Visible = false
  47. game:GetService("MarketplaceService"):PromptProductPurchase(lPlayer, dj_jones)
  48. else
  49. cGUI.CoreFrame.CoreTag.PasteIDBtn.Text = "That is not a valid ID."
  50. end
  51. end)
  52. function FadeOutSound(sound)
  53. local basevol = sound.Volume
  54. local count = math.ceil(60)
  55. if count < 1 then
  56. count = 1
  57. end
  58. for i = 1, count do
  59. if sound then
  60. sound.Volume = sound.Volume - basevol / count
  61. wait(0.03333333333333333)
  62. end
  63. end
  64. if sound then
  65. sound:Stop()
  66. sound.TimePosition = 0
  67. end
  68. end
  69. replicatedstorage.ChangeClientDJSong.OnClientEvent:connect(function(mode, soundID)
  70. if mode == "countdown" then
  71. script.DJBoard.TimerFrame.Visible = true
  72. script.DJBoard.TimerFrame.TimerTag.Text = soundID
  73. elseif mode == "changesong" and lPlayer ~= nil and lPlayer:FindFirstChild("PlayerGui") then
  74. if lPlayer.PlayerGui.LocalBackgroundMusic:FindFirstChild("BGM") == nil then
  75. return
  76. end
  77. FadeOutSound(lPlayer.PlayerGui.LocalBackgroundMusic.BGM)
  78. lPlayer.PlayerGui.LocalBackgroundMusic.BGM.SoundId = "rbxassetid://" .. soundID
  79. lPlayer.PlayerGui.LocalBackgroundMusic.BGM.TimePosition = 0
  80. lPlayer.PlayerGui.LocalBackgroundMusic.BGM.Volume = 1
  81. lPlayer.PlayerGui.LocalBackgroundMusic.BGM:Play()
  82. script.DJBoard.SongID.Text = soundID
  83. end
  84. end)
  85. function replicatedstorage.RequestSoundID.OnClientInvoke()
  86. return lPlayer.PlayerGui.SongGUI.CoreFrame.CoreTag.PasteIDBtn.Text
  87. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement