What is wrong with my Music Module? It creates errors.
Hello, I am experiencing an error while programming a music script. I don't know how to make it loop but, I'm currentley experiencing an error when I am getting the music ID's from the module I made to store audio information. I will attach the scripts here:
01 | local MusicModule = require(game.ServerScriptService.RestaurantFramework.Music.PlaylistModule) |
02 | local Music = game.ReplicatedStorage.Music |
03 | local isPlaying = false |
06 | for i, SongFile in pairs (MusicModule.Playlist) do |
09 | Music.Volume = SongFile.VolumeLevel |
12 | print (SongFile, "finished!" ) |
This script errors with:
1 | ServerScriptService.RestaurantFramework.Music.MusicScript: 8 : attempt to index number with 'ID' |
My Module contains the following:
01 | local PlaylistModule = { } |
03 | PlaylistModule.Playlist = { |
05 | Title = "Dance Monkey" , |
07 | AudioLength = 150.386 , |
10 | Title = "Aku Suka Body Mama Muda Roblox" , |
Am I missing something because, they both try to run at the same time but, I want the songs to play one by and then play the next after its finished. Is there a method to achieve this? I'm also struggling to make it loop so, if anyone can help I'd appreciate it.