GIF proving this code works.
http://imgur.com/Io97MhX
local Teams, Players, Nothing, Runservice ={
{"Team1", "Really blue"};
{"Team2", "Really red"};
}, game:GetService("Players"), math.randomseed(tick()), game:GetService("RunService")
function change_teams()
for _,p in next,Players:GetPlayers() do
local cTeam =Teams[math.random(1, #Teams)]
local Player =p
Player.TeamColor =BrickColor.new( cTeam[2] )
print(p.Name.."'s name is now "..cTeam[1])
end
end
if Runservice:IsStudio() then
print("Your in studio! I need to wait until the game is done loading!")
repeat wait() until game.Loaded
workspace:WaitForChild(game.Players.LocalPlayer.Name)
end
print("Game loaded! I will start my loop!")
while true do
change_teams()
wait(5)
end
2 comments
Messor you still go on this website? WHAT?!
Yes