|
| 21 Sep 2011 06:02 PM |
Here's my piece of code, but it doesn't work. When my script gets here, it just stops.
for _,v in pairs (game.Players:GetChildren()) do pcall(function() v.Character:MoveTo(math.random(2,#newMap.ASpawn)) end) end |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 21 Sep 2011 06:03 PM |
for _,v in pairs (game.Players:GetChildren()) do pcall(function() v.Character:MoveTo(math.random(2,#newMap.ASpawn)) end)
I don't see a reason for a second end O_O |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2011 06:04 PM |
| The second end is for the "for _,v in pairs" thing. *facepalm* |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 21 Sep 2011 06:05 PM |
for _,v in pairs(game.Players:GetChildren()) do v.Character:MoveTo(Vector3 coordinates) end |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2011 06:07 PM |
| @Grimm - For one, that doesn't move the character to one of the random set spawns, and for two, WAY too much work to send to a coordinate... |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 21 Sep 2011 06:09 PM |
Well, last time I checked, :MoveTo() works only with Vector3 coordinates. Am I wrong? :o |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2011 06:09 PM |
| I'm pretty sure that you can move to a brick. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 21 Sep 2011 06:10 PM |
| You move it to a brick's position, which would return its Vector3 coordinates. |
|
|
| Report Abuse |
|
|
GoldenUrg
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 6428 |
|
|
| 21 Sep 2011 06:39 PM |
You're random seems to imply you have a table of positions:
for _,v in pairs (game.Players:GetChildren()) do pcall(function() v.Character:MoveTo(newMap.ASpawn[math.random(2,#newMap.ASpawn)]) end) end |
|
|
| Report Abuse |
|
|