#For Loop Skipping at Random
18 messages · Page 1 of 1 (latest)
Weird way to do a for loop...
Just do this:
for i = 1, #Waiting:GetPlayers(), 1 do
Waiting:GetPlayers()[i].Team = CrewMate
end
that makes more sense
tried that and it is still skipping
just 1 for a server of 4
and 3 in a server of 8
Do a print for Waiting:GetPlayers()
** You are now Level 1! **
it only registered 2 from the start when there is 3
nevermind it jusr cant complete it when there is one left
but with 8 players it stops with 3 remaining
and says its now nill
for count, player in Waiting:Get players() do
(Assuming that Waiting variable is the player service)
then player.Team = CrewMate
Remove the 'i' variable
Without the space and GetPlayers isn't used for tables where u put in the players by urself
Judging from what ur trying to make, if u want there to be a x impostors and totalPlayere-x crewMates then u could make a function called SetupGame where you select x amount of impostors and then select totalPlayers-x crewMates