Advertisement
RoScripter

Music System Script

Jul 27th, 2020
8,803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. local MarketPlaceService = game:GetService("MarketplaceService")
  2.  
  3. local Songs = {
  4.     12345, --REPLACE 12345 WITH YOUR SONG ID
  5.     12345, --REPLACE 12345 WITH YOUR SONG ID
  6.     12345, --REPLACE 12345 WITH YOUR SONG ID
  7.     12345  --REPLACE 12345 WITH YOUR SONG ID
  8. }
  9.  
  10. local SongObject = script.Parent.Song
  11. local SongLabel = script.Parent.SongLabel
  12. local SkipButton = script.Parent.SkipButton
  13. local MuteButton = script.Parent.MuteButton
  14.  
  15. MuteButton.MouseButton1Click:Connect(function()
  16.     if SongObject.Volume == 0.5 then
  17.         SongObject.Volume = 0
  18.     else
  19.         SongObject.Volume = 0.5
  20.     end
  21. end)
  22.  
  23. SkipButton.MouseButton1Click:Connect(function()
  24.     SongObject:Stop()
  25. end)
  26.  
  27. while true do
  28.     for i = 1, #Songs do
  29.         local Song = Songs[i]
  30.         local SongInfo = MarketPlaceService:GetProductInfo(Song)
  31.        
  32.         SongObject.SoundId = "rbxassetid://" .. Song
  33.         SongObject:Play()
  34.         SongLabel.Visible = true
  35.         SongLabel.Text = SongInfo.Name
  36.         wait(3)
  37.         SongLabel.Visible = false
  38.        
  39.         repeat wait() until not SongObject.IsPlaying
  40.     end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement