I am very new to scripting and have made a countdown, when this countdown reaches zero I want to have a list of the current players in the game and if their index number is even they are placed on Red Team and if it’s odd they are placed on Blue Team.
Currently I really have no idea how to do this, I have tried getting all the players and doing some weird function but that never seemed to work.
local InGame = game.Workspace.MainSystem.InGame.Value
local status = game.workspace.MainSystem.GuiStat
while true do
while InGame == false and status.Value > 0 do
wait(1)
status.Value = status.Value - 1
end
if status.Value == 0 then
InGame = true
status.Value = 10
end
while InGame == true and status.Value > 0 do
wait(1)
status.Value = status.Value - 1
end
end
Here is the script for the countdown and when I turn ‘InGame’ to True I want to sort the teams. Thanks for your help!
I am new and if you need more information please let me know!