How do I use only players of one team in a script?
For example, the team name is "Fighters" and I want to use a function that teams anyone in that team back to Spectators if Fighters has one or less player. If one player then announce the winner, if 0 then announce a tie.
Fight = game.Workspace.Fight.Value
GameVal = game.Workspace.GameVal.Value
Fighters = game.Teams.Fighters:GetChildren()
function finish()
if GameVal == true and #Fighters == 1 then
Fighter = Fighters.FindFirstChild.Name
m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = Fighter.."has won the round!"
GameVal = false
wait(3)
m:remove()
elseif GameVal == true and #Fighters == 0 then
m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = "There has been a tie!"
wait(3)
m:remove()
end
end
Fight.Changed:connect(finish)
Will this work or how should I approach this?

2 comments
Oh okay I need another script to work first, can you tell me whether trying to change the team of a whole team works? Like I am trying
player = game.Players:GetChildren() player.TeamColor = BrickColor.new("Bright green") would that work? Because its not for me.