Music = {
["Bryson Tiller - Been That Way"] = {
Artist = "Bryson Tiller",
ItemId = "http://www.roblox.com/asset/?id = 313095574",
Length = 0
},
["Drake - God's Plan"] = {
Artist = "Drake",
ItemId = "http://www.roblox.com/asset/?id = 1375384985",
Length = 0
},
["Bryson Tiller - You Got It"] = {
Artist = "Brsyon Tiller",
ItemId = "http://www.roblox.com/asset/?id = 977685900",
Length = 0
},
}
So I wanna get a random Item Id in this table. How would I get a random ItemId? Basically, I want it to pull a random Item Id. So then I can still pull the title and the artist of the song. How could this be done? I've been stuck at figuring this out for several minutes.....

3 comments
Use math.random
how would I use math.random to get a random value in my table? lol
It's been awhile since I've done anything to do with lua, but if I'm not mistaken wouldn't it be better to use arrays within an array instead of dictionaries? You'll be able to use the index as an integer rather than a string. You'd then be able to use something like Music[math.random(1, #Music)]