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")

4 comments
replace break with return
Thanks for the response! I have two "break"s in my script, so I tried all three combinations of replacing one of them, but not the other, then replaced the opposite, then replaced both, but the same problem occurred.
I replaced the >= with == for Line 16 and Line 25, which does solve the countdown problem, but still only gives the leaderstat points to Team 1. I'm gonna feel real stupid when you tell me what >= should be replaced with. x.x
^ Updated the script, but the countdown still keeps going after the winner is declared, but it does do the leaderstat awards bumps.