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 5 years ago
Edited by User#5423 5 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:

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?

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

Answer this question