Hello!
Problem: When Team 1 wins, the match results display that they won, but the countdown is still going on.
How can I correct this?
-- Round information for i = 90, 0, -1 do if i == 0 then print('Test1') status.Value = 'Time Up! No Winner!' break else end -- End for Line 84 wait(1) local maxscore = 2 local team1 = game.Teams.Wizards local team2 = game.Teams.Warlocks local PlayersT1 = team1:GetPlayers() local PlayersT2 = team2:GetPlayers() print("Test2") if wizardscore.Value >= maxscore then for i, plr in pairs(team1:GetPlayers()) do status.Value = 'Team Wizards is the Winner!' print("Test3") wait(1) PlayersT1[i].leaderstats.Coins.Value = PlayersT1[i].leaderstats.Coins.Value +5 PlayersT1[i].leaderstats.Experience.Value = PlayersT1[i].leaderstats.Experience.Value + 10 PlayersT1[i].leaderstats.Wins.Value = PlayersT1[i].leaderstats.Wins.Value +1 end -- End for line 97 print("Test4") elseif warlockscore.Value >= maxscore then for i, plr in pairs(team2:GetPlayers()) do status.Value = 'Team Warlocks is the winner!' print("Test5") wait(1) PlayersT2[i].leaderstats.Coins.Value = PlayersT2[i].leaderstats.Coins.Value +5 PlayersT2[i].leaderstats.Experience.Value = PlayersT2[i].leaderstats.Experience.Value + 10 PlayersT2[i].leaderstats.Wins.Value = PlayersT2[i].leaderstats.Wins.Value +1 end -- End for Line 106 print("Test6") break else end -- End for Line 96 status.Value = i..' seconds remaining!' print("Test7") end -- End for Line 83 mapstorage:ClearAllChildren() print("Test8") wizardscore.Value = 0 print("Test9") warlockscore.Value = 0 print("Test10") end -- End for Line 13/While True Do print("Test11")
Problem was solved. :) Just needed to add one more break in the loop above Line 23. Thank you to abnotaddable as always!