hello, i need help with a looping problem i have with my music im playing through my music gui, the script looks like this:

local button = script.Parent

function onClick()
	game.Workspace.Music.BeforeTheStory:Stop()
	game.Workspace.Music.Checkers:Stop()
	game.Workspace.Music.TheLegendOfDeltarune:Stop()
	game.Workspace.Music.ScarletForest:Stop()
	game.Workspace.Music.BattleAgainstATrueHero:Stop()
	game.Workspace.Music.SnowdinTown:Stop()
	game.Workspace.Music.ASGORE:Stop()
	game.Workspace.Music.AltertaleMegalovania:Stop()
	while true do
		game.Workspace.Music.BeforeTheStory:Play()
		wait(88.614999999999994884)
	end
end

button.MouseButton1Click:Connect(onClick)

each song has a script like this but everytime i click a new songs button after a while a previously played song repeats and overlaps the song i want.

i know that the while true do loop is making the music overlap. anyone have any ways to make this work?

2 comments

0

nevermind i fixed it

0

add [Solved] to the title and pls include what you did that solved your question