|
| 25 Jul 2014 01:06 PM |
repeat wait() until #game.Players:GetPlayers() > 4 game.Workspace.WaitingForPlayersMessage:Destroy() game.Lighting.AssigningRolesMessage:Clone().Parent = game.Workspace if #game.Players:GetPlayers() > 4 then 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 military = players[math.random(1, #players)]; table.remove(players, medic); table.remove(players, military); for i, v in pairs(players) do if v then table.insert(scientists, v); alien1.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) alien2.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) medic.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) guard.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) game.Lighting.MilitaryTool:Clone().Parent = military.Backpack game.Lighting.MedicTool:Clone().Parent = medic.Backpack if alien1.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if alien2.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if medic.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if military.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if alien1.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end if alien2.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end if medic.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end if military.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end a = Instance.new("Shirt",military.Character) a.Name = MilitaryShirt a.ShirtTemplate = "http://www.roblox.com/asset/?id=162950220" b = Instance.new("Shirt",military.Character) b.Name = MilitaryPants b.ShirtTemplate = "http://www.roblox.com/asset/?id=162951789" end; end; end |
|
|
| Report Abuse |
|
|
ediee544
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 2175 |
|
| |
|
ediee544
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 2175 |
|
|
| 25 Jul 2014 01:08 PM |
| I don't see any errors, is there output? |
|
|
| Report Abuse |
|
|
EkoGam3
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 343 |
|
|
| 25 Jul 2014 01:11 PM |
The ID's for shirts and pants should always be subtracted by one. And to get the total players in the game, it's game.Players.NumPlayers. I wouldn't put all the semicolons either, but that's just me. They're not necessary. repeat wait() until game.Players.NumPlayers > 4 game.Workspace.WaitingForPlayersMessage:Destroy() game.Lighting.AssigningRolesMessage:Clone().Parent = game.Workspace if game.Players.NumPlayers > 4 then 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 military = players[math.random(1, #players)]; table.remove(players, medic); table.remove(players, military); for i, v in pairs(players) do if v then table.insert(scientists, v); alien1.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) alien2.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) medic.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) guard.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) game.Lighting.MilitaryTool:Clone().Parent = military.Backpack game.Lighting.MedicTool:Clone().Parent = medic.Backpack if alien1.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if alien2.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if medic.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if military.Character:FindFirstChild("Shirt") then char:FindFirstChild("Shirt"):Destroy() end if alien1.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end if alien2.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end if medic.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end if military.Character:FindFirstChild("Pants") then char:FindFirstChild("Pants"):Destroy() end a = Instance.new("Shirt",military.Character) a.Name = MilitaryShirt a.ShirtTemplate = "http://www.roblox.com/asset/?id=162950219" b = Instance.new("Shirt",military.Character) b.Name = MilitaryPants b.ShirtTemplate = "http://www.roblox.com/asset/?id=162951788" end; end; end |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jul 2014 01:56 PM |
| Also, what would be the easiest way to give all the scientists, a shirt and pants and teleport them? |
|
|
| Report Abuse |
|
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 25 Jul 2014 01:56 PM |
| By sorting them into a table. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 03:10 PM |
| I did but how would I teleport them and give them shirts and pants? |
|
|
| Report Abuse |
|
|
| |
|
| |
|