|
| 18 Mar 2014 07:08 PM |
for _, plrs in pairs(cGame.pInRound) do for i, spawns in pairs(game.Workspace[cGame.CurrentMap].spawns:GetChildren()) do plrs.Character:MoveTo(Vector3.new(spawns.Position)) end end
pretty much i want player1 to teleport to spawn1. player2 spawn 2, etc.
If the spawns run out for players(e.g: 6 spawns, 7 players, make player 7 go back to spawn 1)
can someone give me an example how to do this? Because I know I am totally wrong. |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2014 07:12 PM |
for i = 1,game.Players.NumPlayers do for o = 1,#game.Workspace[cGame.CurrentMap].spawns:GetChildren() do local plr = game.Players:GetPlayers()[i] plr.Character:MoveTo(Vector3.new(game.Workspace[cGame.CurrentMap].spawns:GetChildren()[o].Position)) end end
This can be shortened through the use of variables. |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 18 Mar 2014 07:28 PM |
| stop telling people to use numeric for in table iteration |
|
|
| Report Abuse |
|
|
| |
|
| |
|