of     1   

rowerowe71
#141416966Thursday, July 24, 2014 8:22 PM GMT

repeat wait() until #game.Players:GetPlayers() > 4 game.Workspace.WaitingForPlayersMessage:Destroy() game.Lighting.IntermissionMessage:Clone().Parent = game.Workspace wait(10) game.Lighting.IntermissionMessage:Destory() game.Lighting.AssigningRolesMessage:Clone().Parent = game.Workspace local players = game.Players:GetPlayers(); local scientists = {} local alien1 = players[math.random(1, #players)]; local alien2 = players[math.random(1, #players)]; table.remove(players, alien1); table.remove(players, alien2); local medic = players[math.random(1, #players)]; local guard = players[math.random(1, #players)]; table.remove(players, medic); table.remove(players, guard); for i, v in pairs(players) do if v then table.insert(scientists, v); alien1.Player.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) end; end;
cntkillme
#141417082Thursday, July 24, 2014 8:23 PM GMT

No
rowerowe71
#141417516Thursday, July 24, 2014 8:27 PM GMT

why?
cntkillme
#141417859Thursday, July 24, 2014 8:30 PM GMT

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;
rowerowe71
#141418574Thursday, July 24, 2014 8:36 PM GMT

I'm sorry, can you explain better how to remove the players chosen from the table, please?
cntkillme
#141418787Thursday, July 24, 2014 8:38 PM GMT

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 players = game.Players:GetPlayers(); local scientists = {} if #players >= 4 then local alien1 = table.remove(players, math.random(#players)); --table.remove returns the value you removed which is convenient local alien2 = table.remove(players, math.random(#players)); --since you removed it, #players will be 1 less, so no possible duplicates.
cntkillme
#141418865Thursday, July 24, 2014 8:39 PM GMT

The top part is just stuff I forgot to delete, ignore it and look at the bottom part. And since you removed it, #players will be 1 less, so no possible errors*
rowerowe71
#141437592Thursday, July 24, 2014 11:31 PM GMT

So it's all good, if I addd those edits?
cntkillme
#141438109Thursday, July 24, 2014 11:36 PM GMT

I can't say for certain, but it will fix some of the errors I pointed out
rowerowe71
#141488923Friday, July 25, 2014 10:05 AM GMT

Ok, thanks.

    of     1