Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SynapseX Decompiler
- local replicatedstorage = game:GetService("ReplicatedStorage")
- local players = game:GetService("Players")
- local lPlayer = players.LocalPlayer
- local cGUI = lPlayer:WaitForChild("PlayerGui"):WaitForChild("SongGUI")
- local dj_jones = 37158286
- local isNumber = function(str)
- return tonumber(str) ~= nil
- end
- script:WaitForChild("DJBoard").Adornee = workspace:WaitForChild("DJ_BOARD")
- script.DJBoard.PlayBtn.MouseButton1Down:connect(function()
- cGUI.CoreFrame.Visible = true
- end)
- cGUI:WaitForChild("CoreFrame"):WaitForChild("CoreTag"):WaitForChild("CancelBtn").MouseButton1Down:connect(function()
- cGUI.CoreFrame.Visible = false
- end)
- local marketplace = game:GetService("MarketplaceService")
- local function verifyUserInput(assetID)
- local userSuccess, userMessage = pcall(function()
- local isNumber = function(str)
- return tonumber(str) ~= nil
- end
- if isNumber(assetID) then
- if marketplace:GetProductInfo(assetID).AssetTypeId == 3 then
- return true
- else
- return false
- end
- else
- return false
- end
- end)
- if userSuccess then
- if userMessage then
- return true
- else
- return false
- end
- else
- return false
- end
- end
- cGUI.CoreFrame.CoreTag.OKBtn.MouseButton1Down:connect(function()
- if verifyUserInput(cGUI.CoreFrame.CoreTag.PasteIDBtn.Text) then
- cGUI.CoreFrame.Visible = false
- game:GetService("MarketplaceService"):PromptProductPurchase(lPlayer, dj_jones)
- else
- cGUI.CoreFrame.CoreTag.PasteIDBtn.Text = "That is not a valid ID."
- end
- end)
- function FadeOutSound(sound)
- local basevol = sound.Volume
- local count = math.ceil(60)
- if count < 1 then
- count = 1
- end
- for i = 1, count do
- if sound then
- sound.Volume = sound.Volume - basevol / count
- wait(0.03333333333333333)
- end
- end
- if sound then
- sound:Stop()
- sound.TimePosition = 0
- end
- end
- replicatedstorage.ChangeClientDJSong.OnClientEvent:connect(function(mode, soundID)
- if mode == "countdown" then
- script.DJBoard.TimerFrame.Visible = true
- script.DJBoard.TimerFrame.TimerTag.Text = soundID
- elseif mode == "changesong" and lPlayer ~= nil and lPlayer:FindFirstChild("PlayerGui") then
- if lPlayer.PlayerGui.LocalBackgroundMusic:FindFirstChild("BGM") == nil then
- return
- end
- FadeOutSound(lPlayer.PlayerGui.LocalBackgroundMusic.BGM)
- lPlayer.PlayerGui.LocalBackgroundMusic.BGM.SoundId = "rbxassetid://" .. soundID
- lPlayer.PlayerGui.LocalBackgroundMusic.BGM.TimePosition = 0
- lPlayer.PlayerGui.LocalBackgroundMusic.BGM.Volume = 1
- lPlayer.PlayerGui.LocalBackgroundMusic.BGM:Play()
- script.DJBoard.SongID.Text = soundID
- end
- end)
- function replicatedstorage.RequestSoundID.OnClientInvoke()
- return lPlayer.PlayerGui.SongGUI.CoreFrame.CoreTag.PasteIDBtn.Text
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement