Not getting that there's one player left

Hi!

-- Top variables, outside any loop
local Timer = 0
while true do
-- Intermission
-- Round start here:
	Timer = 60
	repeat
 		Timer -= 1
		local PlayingPlayers = 0
		for _, Player in Players:GetPlayers() do
			if Player.Team ~= PlayingTeam then continue end
			PlayingPlayers += 1
		end
		task.wait(1)
	until Timer == 0 or #PlayingPlayers == 1
end
1 Like

You can just do #team:GetPlayers(), it’s much more convenient :smiley:

Perhaps, I normally do not use teams to define how many players that is playing.

2 Likes

Got it working, thank you so much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.