Hello everyone! I am currently working on a script for my game that when a certain button is clicked. It will play a random song for the shop menu. I already know how to use math.random. But, I cannot figure out for the life of me, why this list isn't working. here is the errors I am getting. (Note: I don't receive any errors in the console, only script analysis.)
Errors with code: https://imgur.com/a/cRx7rfS
shopMusicList = { game.Workspace.Soundtrack.ShopSoundtrack.shopMusic_1 game.Workspace.Soundtrack.ShopSoundtrack.shopMusic_2 game.Workspace.Soundtrack.ShopSoundtrack.shopMusic_3 }
Explorer location: https://imgur.com/a/HheZAeT
If anyone knows the reason and can help me out with this, that would be great. :)
You didn't separate the items with a comma in the table. Essentially the code will think that the items in the table aren't needed since the table isn't enclosed at line 15 and hence will cause this error.
Remember to separate the items you want in the table with either a comma or a semi-colon and that will fix the error!
shopMusicList = { game.Workspace.Soundtrack.ShopSoundtrack.shopMusic_1, game.Workspace.Soundtrack.ShopSoundtrack.shopMusic_2, game.Workspace.Soundtrack.ShopSoundtrack.shopMusic_3, }