How to create teams

How do I make a team be created in the game using a script?
(How do I make a team that is visible to everyone, in the server console)

2 Likes
local teams = game:GetService("Teams")

local newTeam = Instance.new("Team", teams)
newTeam.Name = "Team"
newTeam.AutoAssignable = false -- set to true to make everyone spawn with the team.
5 Likes
local team = Instance.new("Team", teams)
team.Name = "Police"
team.TeamColor = BrickColor.new("idksomecolor")

Usually using Instance.new with second argument isnt a good idea because its much slower but it doesnt really matter here. Also you can set the autoassignable property. If its enabled then game will automatically put players if this team unless its bigger than other teams.

1 Like

will this work?

		local teams = game:GetService("Teams")

		local DevTeam = Instance.new("Team", teams)
		DevTeam.Name = "Developers"
		Devteam.TeamColor = BrickColor.new("Deep orange")
		DevTeam.AutoAssignable = false
2 Likes

Yes, there aren’t any problems there.

It doesn’t change the color tho image why?
image
Edit: I found the issue