The first track value plays for about 30 seconds or so, and then it cuts out and doesn't continue. Any ideas on how to fix this?

Mainly looking at the while loop for the problem.

local songs = game.Workspace.trackList

local sound = Instance.new("Sound", songs)
sound.Name = "MusicPlayer"
sound.Volume = volume

local musicLength = songs.MusicPlayer.TimeLength

while true do
	for i = 1, #trackValues do
		sound.SoundId = trackValues[i]
		songs.MusicPlayer:Play()
		wait(musicLength)
		sound.MusicPlayer:Stop()
		wait(3)
	end
end

3 comments

1

I noticed that at line 14 you did 'sound.MusicPlayer:Stop()' that can't be right, at line 12 you did songs.MusicPlayer as well so

0

what exactly is "volume"

0

local volume = 0.3