Character keeps spawning at sniper location sometimes but not always i tried to make the max team amount for Sniper be = 1 but it doesnt seem to work fully Please help me here is the code:

function GetPlayersOnTeam(Sniper)
	local count=0;
	for i,v in next, game.Players:GetPlayers() do
		if v. InstitutionalWhite== Sniper then
			count=count+1
			end
			end
			return count;
			end

local Sniper=BrickColor.new("InstitutionalWhite")
local Ducks=BrickColor.new("Really_black")
local max_Ducks=10

game.Players.PlayerAdded:Connect(function(player)
	if GetPlayersOnTeam(Ducks)<max_Ducks then
		player.InstitutionalWhite=Sniper
		else player.Really_black=Ducks
	end
end)