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

2 comments
There's nothing wrong with the script that I can see. Ensure that the script actually executes, and that you are attempting with at least 3 test players. Make sure you actually have those teams in game.Teams
For some reason the script doesnt seem to be executing?