How do I put all players on one team

Hello! I am making a game and when the countdown is over I want to put all players onto one team. I have done some searching but can’t find a definitive answer. It’s probably super simple but I am not that good at scripting. Thanks for the help!

2 Likes

First, you will have to loop through the Players service. Then, for all player, you can change their Team and Team Color.

1 Like
local Players = game:GetService("Players")
if countdown = 0 then -- assuming you already have the countdown
Players.Team = -- the team
end
-- after countdown 

local Teams = game:GetService("Teams")
local Players = game:GetService("Players")

local Team = Teams["Red Team"] -- assuming it exists implicitly 

for _, player in ipairs(Players:GetPlayers()) do
   player.Team = Team 
end

Iterate to change every player’s team.

3 Likes

Tysm! it worked! Now I can proceed with my game!