while true do
wait(2)
local numSheriffs = #game.Teams.Reds:GetChildren()
local numPsy = #game.Teams.Blues:GetChildren()
-- Checking for Blues
if numBlue == 0 then
print("Winner is Red!")
break
end
-- Checking for Reds
if numRed == 0 then
print("Winner is Blue!")
break
end
end
My script check for players in each team to see which one has the most players. The problem is, if Blue is empty and Red is full, it's still going to print "Winner is Blue."
So in the output I see
Winner is Red!
Winner is Blue
But I only want to see the real winner. Blue or Red. Depending on who has the most players.
(I hope this isn't too confusing. Thanks!) |