Computed
|
  |
| Joined: 03 Sep 2012 |
| Total Posts: 554 |
|
|
| 11 Feb 2017 05:21 AM |
| I'm trying to teleport players onto ## map. ### Teleporting players onto the map players = ########################## for i = 1, #players do plrName = players[i].Name toMove = workspace.plrName.Torso toMove.CFrame = CFrame.new(-4752.6, 8, 17.2) end end However, ## script reaches this block of code and seemingly does nothing. Help? |
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 05:21 AM |
players = game.Players:GetChildren() for i = 1, #players do plrName = players[i].Name toMove = workspace.plrName.Torso toMove.CFrame = CFrame.new(-4752.6, 8, 17.2) end end |
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 05:21 AM |
Is what I meant to post. OP is my alt.
How do I fix my code so that players are teleported? |
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
| |
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
| |
|
|
| 11 Feb 2017 05:32 AM |
players have a useful property called 'character'
its a reference to the players character, so you don't have to find them in workspace
players = game.Players:GetChildren() for i = 1, #players do toMove = players[i].Character toMove.CFrame = CFrame.new(-4752.6, 8, 17.2) end end
|
|
|
| Report Abuse |
|
|
| |
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
| |
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
| |
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
| |
|
|
| 11 Feb 2017 05:43 AM |
repeat wait() until game.Players.NumPlayers > 0
players = game.Players:GetChildren() for i = 1, #players do wait() toMove = players[i].Character.Torso toMove.CFrame = CFrame.new(-4752.6, 8, 17.2) end
|
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 05:45 AM |
still nope ;c
it's part of a bigger script, in which an intermission banner counts down the time, announces that the round has started, map spawns and then my next step is this teleporting part
script is in serverscriptservice |
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 05:46 AM |
| I get error position is not # member of model |
|
|
| Report Abuse |
|
|
| |
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 05:49 AM |
yeah idk i think it may be referring to me spawning in the map
i used your code exactly and the map spawns and nobody teleports no error message either so
like what? |
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 05:52 AM |
an error in the script before that code executes results in it failing
i just stuck a print statement in and found that the code never reached your lines
ty i will modify |
|
|
| Report Abuse |
|
|
edenDeden
|
  |
| Joined: 29 Jul 2016 |
| Total Posts: 370 |
|
|
| 11 Feb 2017 05:55 AM |
GetPlayers() and GetChildren() is the same for game.Players?
|
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 05:58 AM |
Chers disill it works perfectly now
<3 |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2017 05:58 AM |
btw computed as a way better username than jackudy
|
|
|
| Report Abuse |
|
|
Jackudy3
|
  |
| Joined: 22 Sep 2011 |
| Total Posts: 8446 |
|
|
| 11 Feb 2017 06:01 AM |
| ikr but i name sniped computed a year or two after joining and this has always been my main so |
|
|
| Report Abuse |
|
|