djwill619
|
  |
| Joined: 13 Jun 2011 |
| Total Posts: 756 |
|
|
| 21 Mar 2014 02:38 PM |
How Would I Move All The Players To Different Positions? I Know How To Use :MoveTo() |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 02:40 PM |
Loop through the players service.
for Index, Player in pairs(Game:GetService("Players"):GetPlayers()) do if Player.Character then Player.Character:MoveTo(Vector3.new(0, 0, 0)) --Position here end end
|
|
|
| Report Abuse |
|
|
djwill619
|
  |
| Joined: 13 Jun 2011 |
| Total Posts: 756 |
|
|
| 21 Mar 2014 02:44 PM |
| How Would I Do That For Every Player? |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 02:45 PM |
| Im pretty sure thats for all players ^ |
|
|
| Report Abuse |
|
|
djwill619
|
  |
| Joined: 13 Jun 2011 |
| Total Posts: 756 |
|
|
| 21 Mar 2014 02:53 PM |
| Indiviualy, like teleport 1 player to 0,0,0 and another to 3,3,3 |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 03:15 PM |
If you want to teleport each player to a different spot, you have to do it individually.
If you are teleporting them to a map, you can put part locations in a table and remove them once a player gets teleported to it (so two players don't go to the same location). For example, let's say you want to teleport players to a sword fighting arena, but you don't want two players to go to the same spot:
local teleport_parts = {} }
--initialize the teleport parts, add them to a table if they are named "tpPart" for i, v in pairs(Workspace.Map:GetChildren()) do if v.Name == "tpPart" then table.insert(teleport_parts, v.Position) end end
--now teleport each player to a tpPart local players = game.Players:GetPlayers() for i, v in pairs(teleport_parts) do players[i]:MoveTo(Vector3.new(v)) end
--clear the teleport_parts table teleport_parts = {}
|
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 03:16 PM |
Oops, I made a typo. Here it is fixed:
local teleport_parts = {} }
--initialize the teleport parts, add them to a table if they are named "tpPart" for i, v in pairs(Workspace.Map:GetChildren()) do if v.Name == "tpPart" then table.insert(teleport_parts, v.Position) end end
--now teleport each player to a tpPart local players = game.Players:GetPlayers() for i, v in pairs(teleport_parts) do players[i].Character:MoveTo(Vector3.new(v)) end
--clear the teleport_parts table teleport_parts = {}
|
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 07:48 PM |
That would only teleport the amount of people there are 'tpPart's. He can simply group the spawns into a model and do something like:
local Spawns = Workspace.Spawns:GetChildren() for Index, Player in pairs(Game:GetService("Players"):GetPlayers()) do if Player.Character then Player.Character:MoveTo(Spawns[math.random(#Spawns)]) end end |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 21 Mar 2014 07:52 PM |
c = game.Players:GetChildren() for i = 1,#c do c[i].Character.Torso.CFrame = CFrame.new(x,y,z) end
or
for i,v in piars(game.Players:GetChildren()) do v.Character.Torso.CFrame = CFrame.new(x,y,z) end |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 07:56 PM |
Or...
A = -3 B = -3 C = -3 Players = game.Players:GetPlayers() for I = 1,#Players do A = A + 3 B = B + 3 C = C + 3 Players[I].Character:MoveTo(A, B, C) end
I mean. Seriously... |
|
|
| Report Abuse |
|
|