Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make it so there can only be one player on a team?

What i mean is how can i get a script that makes it so there can only be one player on a team. I have three teams.

  1. Smashers
  2. Crushers
  3. Destroyers

1 answer

Use a PlayerAdded connection on the team and check if there is more than one person by using GetPlayers() on the team. Example:

local Team=game:GetService'Teams'.TeamName
Team.PlayerAdded:Connect(function(Player)
	if #Team:GetPlayers()>1 then
		Player.Team=nil
	end
end)

2 comments

0

On top of that check which team doesn't have a player in it and put that player in it and of course don't forget limiting your max players per server to 3 players only

0

Si i did that already.

This discussion is preserved as it was. New answers, comments, and votes are closed.