SHARE
TWEET

Robloxian Virtual Console - Music Player

Leafdragon Jun 17th, 2019 (edited) 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local songs = {
  2.     {
  3.         id = 1836691988,
  4.         title = "Blow Ya Away"
  5.     },
  6.     {
  7.         id = 2862170886,
  8.         title = "Old Town Road"
  9.     },
  10.     {
  11.         id = 209864226,
  12.         title = "Barrack Obama Sings Uptown Funk"
  13.     }
  14. }
  15. local selection = 1
  16. function _update()
  17.     color(1)
  18.     clear()
  19.     color(11)
  20.     rect(0, 0, screenWidth(), 64)
  21.     color(1)
  22.     local active = songs[selection] or {}
  23.     local title = active.title or "unknown"
  24.     local id = active.id
  25.     print(title, 0, 0, 4, false)
  26.     if btnp("Left") then
  27.         if selection > 1 then
  28.             selection = selection - 1
  29.             local active = songs[selection] or {}
  30.             local id = active.id
  31.             if id then
  32.                 play_sound(id, "1", 1, 1)
  33.             end
  34.         end
  35.     end
  36.     if btnp("Right") then
  37.         if selection < #songs then
  38.             selection = selection + 1
  39.             local active = songs[selection] or {}
  40.             local id = active.id
  41.             if id then
  42.                 play_sound(id, "1", 1, 0)
  43.             end
  44.         end
  45.     end
  46. end
  47. local active = songs[selection] or {}
  48. local title = active.title or "unknown"
  49. local id = active.id
  50. if id then
  51.     play_sound(id, "1", 1, 0)
  52. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top