Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local songs = {
- {
- id = 1836691988,
- title = "Blow Ya Away"
- },
- {
- id = 2862170886,
- title = "Old Town Road"
- },
- {
- id = 209864226,
- title = "Barrack Obama Sings Uptown Funk"
- }
- }
- local selection = 1
- function _update()
- color(1)
- clear()
- color(11)
- rect(0, 0, screenWidth(), 64)
- color(1)
- local active = songs[selection] or {}
- local title = active.title or "unknown"
- local id = active.id
- print(title, 0, 0, 4, false)
- if btnp("Left") then
- if selection > 1 then
- selection = selection - 1
- local active = songs[selection] or {}
- local id = active.id
- if id then
- play_sound(id, "1", 1, 1)
- end
- end
- end
- if btnp("Right") then
- if selection < #songs then
- selection = selection + 1
- local active = songs[selection] or {}
- local id = active.id
- if id then
- play_sound(id, "1", 1, 0)
- end
- end
- end
- end
- local active = songs[selection] or {}
- local title = active.title or "unknown"
- local id = active.id
- if id then
- play_sound(id, "1", 1, 0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement