I know this may be a stupid question but i want to know how to make a table with the songs name and the song id along with it like this(This is just music i test with it)
local Songs = {
["Old Town Road"] = 2862170886,
["Verzache - Needs"] = 3777427220,
["You Better Run"] = 2352608398,
["Truncate - WRKTRX 3"] = 2352639731,
["Wheats"] = 2639964810,
["SPOOKY SCARY SKELETONS"] = 160442087,
["Revenge"] = 627722878
}
I want to be able to have the script get the song name, and fire that to the server to show all clients what is playing in a text lable(I already have all that set up) but i can't get the table to give the name and the id so i can set the id in the script and make it play while telling everyone whats playing. for one it just returns nil or it will give me just the song id, i have tried everything i know to do and it fails.
this is the function i am using to get the song id, and this keeps returning an error saying " bad argument #2 to 'random' (interval is empty)"
function PickSong()
local Song = Songs[math.random(1,#Songs)]
local picked = Songs[Song]
print(picked)
end

1 comment
I made a song gui that was REAALLY similar to this if you want to use it?