Advertisement
Josemmoya

Untitled

Feb 10th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. --Settings--
  2.  
  3. song_ID = {2545306148,2597271983,2735918317,904026459} -- replace the numbers with the ID's of the songs you want. (the URL end number)
  4.  
  5. randomizer = true -- set to true is a random number, set to false and it is in order
  6.  
  7. Wait_Time = 120 -- 120 is the max time for a sound/song. Add 5 seconds if you want a buffer between songs
  8.  
  9. inc = 10 -- this is the increment of which the volume increases/decreases for fade in/out.
  10.  
  11. --[[OWNER SETTINGS -- this is the settings prefered by TigerCaptain --
  12. randomizer = false
  13. Wait_Time = 115
  14. inc = .1
  15. ]]
  16.  
  17. --functions and IDs--
  18. asset_ID = "http://www.roblox.com/asset/?id="
  19. function choose(tab) local obj = tab[math.random(1,#tab)] return obj end
  20. function play(s) if s:IsA("Sound") then local o = s.Volume s.Volume = 0 s:play() for i = 0,o,inc do wait() s.Volume = i end s.Volume = o end end
  21. function stop(s) if s:IsA("Sound") then local o = s.Volume for i = o,0,-inc do wait() s.Volume = i end s:stop() s.Volume = o end end
  22. song = Instance.new("Sound",workspace) song.Name = "TigerCaptain's Music Player"
  23.  
  24.  
  25. --loop--
  26. counter = 1
  27. if #song_ID > 0 then
  28. while true do
  29. wait()
  30. if randomizer then song.SoundId = asset_ID..""..choose(song_ID) else song.SoundId = asset_ID..""..song_ID[counter] end
  31. play(song)
  32. wait(Wait_Time)
  33. stop(song)
  34. if counter >= #song_ID then counter = 1 else counter = counter + 1 end
  35. end
  36. end
  37.  
  38.  
  39. --TigerCaptain--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement