Resetting gamemode after objective reached

When a team wins, i have it restart the whole map just to redo the simple gamemode
How do i make it at the end of round, it says resting round, then puts everyone to team 2
i have the rest all setup, i just cant seem to manage to work out ply.GetAll()

If you just want to change everybody’s team to 2

[lua]for k,v in pairs(player.GetAll()) do
if IsValid(v) then
v:SetTeam(2)
end
end[/lua]