This is just a Question as I’m not sure whether this will affect my script or not
So I am trying to get all the Players in the Server and put them inside a Table, i am checking if its not equal to nil so I can insert the player into the Table, but I added continue, I have tried using break but it affects my script by only adding and teleporting one player, will continue do the same?
function GetPlayers()
for num,plr in Players:GetPlayers() do
if plr ~= nil then
table.insert(AlivePlayers, plr)
end
continue -- Will it affect my script like "break"?
end
print(AlivePlayers)
end
It still applies. A variable will never become nil unless it goes out of scope or you make it nil. You could check that their parent isn’t nil instead, but the odds of a player leaving in the literal nanoseconds that this code runs for are extremely slim. The odds might even be zero, depending on how the threading and task scheduler work.