Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved]How to fix looping music in a music gui?

Asked by 6 years ago
Edited by User#5423 6 years ago

This question has been solved by the original poster.

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

01local button = script.Parent
02 
03function onClick()
04    game.Workspace.Music.BeforeTheStory:Stop()
05    game.Workspace.Music.Checkers:Stop()
06    game.Workspace.Music.TheLegendOfDeltarune:Stop()
07    game.Workspace.Music.ScarletForest:Stop()
08    game.Workspace.Music.BattleAgainstATrueHero:Stop()
09    game.Workspace.Music.SnowdinTown:Stop()
10    game.Workspace.Music.ASGORE:Stop()
11    game.Workspace.Music.AltertaleMegalovania:Stop()
12    while true do
13        game.Workspace.Music.BeforeTheStory:Play()
14        wait(88.614999999999994884)
15    end
16end
17 
18button.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?

0
nevermind i fixed it kie1605 0 — 6y
0
add [Solved] to the title and pls include what you did that solved your question User#5423 17 — 6y

Answer this question