I'll just say why it won't work, and not the inefficient parts:
local players = game.Players:GetPlayers();
local scientists = {}
local alien1 = players[math.random(1, #players)]; --possibility people left before this runs since you gave a large wait time
local alien2 = players[math.random(1, #players)]; --possibility of duplicate
table.remove(players, alien1); --remove takes index, not value (so use the number random returned)
table.remove(players, alien2); --remove takes index, not value (so use the number random returned)
local medic = players[math.random(1, #players)]; --same
local guard = players[math.random(1, #players)]; --stuff
table.remove(players, medic); --as
table.remove(players, guard); --above
for i, v in pairs(players) do
if v then --useless, but won't cause an error (pairs skip nil values)
alien1.Player.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) --.Character, not .Player
end;
end; |