I am making a cops and robbers game it needs a minimum of 4 players to start. I need a script where it split everyone randomly. I've tried my all to find a way to do it and nothing seems to work. I really need help with this. Thanks
I suggest that you use this template script:
for index, player in pairs(game.Players:GetChildren()) do if index % 2 == 0 then --Assign to the Cops Team else --Assign to the Robbers Team end end
Its a simple script, that might always give off the same result (Players always being on one team instead of the other) but that will change if players are leaving the game and joining the game.