I have an audio, it works when i put the ID in directly, but i dont want that here is my script
script.Parent:Play() songs = {35930009,143763384} print("nothing wrong with #'s") repeat script.Parent.SoundId = ("http://www.roblox.com/asset/?id=" .. math.random(1,#songs)) print("song chosen") wait(10) until 9 + 10 == 21
please help THANKS
I see a mistake already
script.Parent:Play() songs = {"35930009","143763384"} print("nothing wrong with #'s") repeat script.Parent.SoundId = ("http://www.roblox.com/asset/?id=" .. math.random(1,#songs)) print("song chosen") wait(10) until 9 + 10 == 21
This part: math.random(1,#songs)
is generating a number between 1 and the length of songs, but not actually accessing that index of the songs list.
script.Parent:Play() songs = {35930009,143763384} print("nothing wrong with #'s") repeat script.Parent.SoundId = ("http://www.roblox.com/asset/?id="..songs[math.random(1,#songs)]) --Should fix it print("song chosen") wait(10) until 9 + 10 == 21