Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Script is pausing loops instead of ending them?

Asked by 10 months ago

So I have a round based game and if all the players in a team die then it will break the for loop and continue. That's what I want it to do. What it's actually doing is pausing the timer for about 5 seconds and continue. Please help..!

-- the parts that really matter
                for countdown = 300,0, -1 do
    if script.endRound.Value == true then
        script.CountDown.Value = 0
        break
    end
    if game.Workspace.Radio.Activated.Value == true then
        wait(20)
        script.CountDown.Value = 0
        for _, v in pairs(Players:GetChildren()) do
            if v.TeamColor == BrickColor.new("Dark stone grey") then
                v.leaderstats.Cash.Value = v.leaderstats.Cash.Value + 50
            end
        end
        script.CountDown.Value = 0
        break
    end
    for _, v in pairs(Players:GetChildren()) do
        if v.TeamColor ~= BrickColor.new("Dark stone grey") then
            for _, v in pairs(Players:GetChildren()) do
                v:LoadCharacter()
                script.endRound.Value = true
                wait(5)
                script.endRound.Value = false
            end
        end
    end
    script.CountDown.Value = countdown
    wait(1)
end
0
5 seconds? there is something wrong with "wait(5) script.EndRound.Value = false. digameschannel 44 — 10mo
0
I'm on my phone right now, but the if statement when it breaks it is really just pausing it until the value is false... Does that make sense? NiroTurtle 83 — 10mo

Answer this question