Teams Full Not working?

So im trying to make it so theres one seeker But in test mode it keeps putting 2 seekers instead of keeping it to 1 how am i able to make it so theres a limit to each teams because this code i made doesnt work? unless im doing something wrong please help me :+1:

game.Players.PlayerAdded:Connect(function(plr)
	local Check = game:GetService("Teams")["Seeker"]:GetPlayers()
	local CheckNumber = #Check
	
	if CheckNumber <= 1 then
		if plr.Team == Teams["Seeker"] then
			wait(time)
			local gear = game.ReplicatedFirst.Gear.Stick:clone()
			gear.Parent = plr.Backpack
		end
	end
end)

did you define “Teams”?

as Game:GetService(“Teams”) ??

@4ny5

and you never put the player teams inside the script?

its defined just forgot to put it inside of the code its

game.Players.PlayerAdded:Connect(function(plr)
	local Check = game:GetService("Teams")["Seeker"]:GetPlayers()
    local Teams = game:GetService("Teams")
	local CheckNumber = #Check
	
	if CheckNumber <= 1 then
		if plr.Team == Teams.Seeker then
			wait(time)
			local gear = game.ReplicatedFirst.Gear.Stick:clone()
			gear.Parent = plr.Backpack
		end
	end
end)

did you put any player?

i don’t see any plr.Team = Teams[“Seeker”] .

only in an if statemnt?

This says if CheckNumber is Less than OR EQUAL to 1 then add a Seeker. You should be checking if it’s just less than:

if CheckNumber < 1 then
1 Like

I’m just having a hard time understanding what you’re trying to explain to me
thing is my script is working i just want to know how do you make a max team script :laughing:

Alright thanks so if i do

game.Players.PlayerAdded:Connect(function(plr)
	local Check = game:GetService("Teams")["Seeker"]:GetPlayers()
	local CheckNumber = #Check
	
	if CheckNumber < 1 then
		print("D")
	end
end)

So is this the correct way?

2 Likes

You’re making it so that it checks if there’s either no or 1 seekers already in the team. You should use the < operation instead.