The purpose of this script is to divide people evenly across 3 teams.
My Problem When ever trying to use this script it causes nothing to happen, and with no errors what so ever.
RequiredPlayers = 3 Teams={"VIP", "Guards", "Assasin"} while true do player = game.Players:GetChildren() wait(1) if #player >= RequiredPlayers then Assign() break end end function Assign() local players = game.Players:GetChildren() for i = 1,#players do local ChosenTeam = Teams[math.random(1,#Teams)] players[i].TeamColor = game.Teams:FindFirstChild(ChosenTeam).TeamColor print("Teams Assigned") end end
Thanks
Does it execute in studio mode? Or is it in play mode? IF it's in play mode press F9 and see what error you get
You put the infinite loop before the function itself means the script will never read it. Put the function before the infinite loop