|
| 29 Sep 2013 03:43 PM |
for i,v in pairs(game.Players:GetChildren()) do table.insert(players,v.Name) end d=-73.4 for i,v in pairs(players) do chr=game.Workspace:findFirstChild(v) chr.Torso.CFrame=CFrame.new(d,8,-93.9) d=d+15 end
So thats the script im currently using. It takes all players, then moves each character to a spot 15 studs apart. Works perfectly fine. That is, until it happens again. The players end up in the position 15 studs after the last person of the last time they were all moved. I believed by having "d" defined just before the loop it would reset the value of d. Im not quite sure why it doesnt work. Anyone see the problem? |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2013 03:45 PM |
| Your d=d+15 is before they teleport so it adds 15 when its done |
|
|
| Report Abuse |
|
|
| |
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 29 Sep 2013 03:48 PM |
for i,v in pairs(game.Players:GetChildren()) do table.insert(players,v.Name) end
for i,v in pairs(players) do chr=game.Workspace:findFirstChild(v) chr.Torso.CFrame=CFrame.new(d,8,-93.9) d=d+15 end d=-73.4
Did you try putting it after the loop? |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2013 03:50 PM |
| agh nevermind guys. I figured it out. Its the fact that it re-adds the players again to the player table. I just put a line resetting the "players" table that the first loop adds to. Now it works just fine. |
|
|
| Report Abuse |
|
|