This is what I have made so far.
if players == 2 or 4 or 6 or 8 or 10 then -- The proccess end
This is what I have made so far.
if players == 2 or 4 or 6 or 8 or 10 then -- The proccess end
I wish you wouldn't be so broad with what you need but this script will suffice I hope. What you need to do is get all the players, with getplayers method on game.Players, then you need to take out half of them and put them somewhere else to access half of all players later on.
local players = game.Players:GetPlayers()
local halfPlayers = {}
local num = 1
while num <= #players / 2 do
wait()
num = num + 1
table.insert(halfPlayers,players[num])
end
--You can access half the players with the table 'halfPlayers'
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
This is not a request site. If you could, please put more effort into your script. Thank you.
I'm not requesting a script I'm asking for a method to divide players...
Use a for loop to loop through the players. Then, if the current index of the table is odd, place them on one team, but if the current index is even, place them on the other. This will evenly split the teams
Oh ok thx