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

Why aren't the songs repeating?

Asked by 3 years ago
Edited 3 years ago

So, I've been working on a script that repeats some songs (MSCA through MSCD) on loop unless the Loop value is equal to 0, but when I test the game it plays MSCA and then silence. Why won't it cycle through the other songs? I'm not really too good with this kind of stuff, sorry if the answer is stupidly basic. btw this is all activated when a light (L) is turned on with a proximity prompt.

L.ProximityPrompt.PromptButtonHoldEnded:Connect(function(Toucher)
    BRCK:Destroy()

    Clicked = true

    MSCA:Play()

    L.Material = Enum.Material.Neon
    L.ProximityPrompt:Destroy()
    workspace.Light.Bulb.SpotLight.Enabled = true
    workspace.Light.Bulb.SurfaceLight.Enabled = true
    LNG.Contrast = 0

    repeat
        MSCA.PlaybackSpeed = MSCA.PlaybackSpeed + 0.01
        wait(0.01)
    until MSCA.PlaybackSpeed >= 1
end)

while Loop == 1 do
    if Clicked == true then
        if MSCA.IsPlaying == false and MSCC.IsPlaying == false and MSCD.IsPlaying == false then
            FirstTimePlayed = true
            MSCB:Play()
        end
        wait(0.01)

        if MSCB.IsPlaying == false and MSCA.IsPlaying == false and MSCD.IsPlaying == false then
            MSCC:Play()
        end
        wait(0.01)

        if MSCC.IsPlaying == false and MSCB.IsPlaying == false and MSCD.IsPlaying == false then
            if FirstTimePlayed == false then
                MSCA:Play()
            end
        end
        wait(0.01)

        if MSCC.IsPlaying == false and MSCB.IsPlaying == false and MSCA.IsPlaying == false then
            MSCD:Play()
        end
        wait(0.01)

        if Loop == 0 then
            break
        end
        wait(0.01)
    end
end
0
To make a song repeat, you can go to the properties window and see a property named Looped or just do it in a script: soundobject.Looped = true; sound object refers to your sound. MarkedTomato 810 — 3y
0
I'm trying to get multiple songs, MSCA (Music A) to MSCD (Music D), to repeat after one another. chemistk1 7 — 3y

Answer this question