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

Trying to put all players on a team into a different one. but no error?

there are no errors at all to tell me what is wrong. I don't know what to do.

local Spectators = game:GetService("Teams").Spectating:GetPlayers()
while true do
	wait(5)
	print("Checking")
	for i = 1, #Spectators do
		Spectators[i].TeamColor = game:GetService("Teams").MTF.TeamColor
		Spectators[i]:LoadCharacter()
		print(#Spectators)
	end
	wait(150)
	for i = 1, #Spectators do
		Spectators[i].TeamColor = game:GetService("Teams").Chaos.TeamColor
		Spectators[i]:LoadCharacter()
		print(#Spectators)
	end
end

1 answer

You need to set the player's Team as well as their TeamColor.

-- ...
Spectators[i].TeamColor = game:GetService("Teams").MTF.TeamColor
Spectators[i].Team = game:GetService("Teams").MTF
-- ...

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