Change Team Script?

Currently making an obby game and I’m wanting to be able to have a timer, once it runs out, You will teleport back to spawn and change your team back to “Easy”. I’ve got everything working besides with teams… is there anything that can change everyone’s teams within a script?

3 Likes

I believe using player.Team = game.Teams.TeamName changes the player’s team. If you wanted it to fire for every player, you would have to use remote events and Fire all Clients.

7 Likes

I don’t think it works? I got my Teams folder with my difficulties in it while my character doesn’t change those difficulties. But I do have another way to go with this by doing no colliding parts that change my team ontouch

3 Likes

You’d have to loop around the Players folder in the explorer here’s an example

local Players = game:GetService("Players")

wait(10)

for i, v in pairs(Players:GetChildren()) do
	if v:IsA("Player") then
		v.Team = game.Teams.Blue
	end
end

I hope this helps!

16 Likes

This worked!! Thank you, I appreciate it!

1 Like