|
| 24 Jul 2013 12:35 AM |
local chosen = game.Players:GetChildren()[math.random(1, #game.Players:GetChildren())] local char = chosen.Character local hum = char.Humanoid local players = game.Players:GetChildren() local pchar = players.Character local phum = pchar.Humanoid pchar:MoveTo(spawn.Position) wait(0.5) hum:MoveTo(enemyspawn.Position)
Player won't teleport somehow -.- Outputs: None, because it is on Play Solo + I cannot see output on Start Server mode, no player existed -.- |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
QuFileC
|
  |
| Joined: 19 Feb 2013 |
| Total Posts: 49 |
|
|
| 24 Jul 2013 01:11 AM |
| What are you talking about? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
6e8
|
  |
| Joined: 21 Jul 2013 |
| Total Posts: 10 |
|
|
| 24 Jul 2013 01:23 AM |
It doesn't work because you specified your player as game.Players:GetChildren().Character
Put this as your character:
local pchar = chosen.Character |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Jul 2013 01:39 AM |
Be patient.
Why are you trying to get the character of a player table?
local players = game.Players:GetChildren() <--This is a table. local pchar = players.Character <--Character is a member of player objects.
Also, Humanoid:MoveTo(Position) makes you walk, not teleport. Just use :MoveTo on the character, it's a completely different function, but it has the same name... |
|
|
| Report Abuse |
|
|
shayan414
|
  |
| Joined: 11 Aug 2008 |
| Total Posts: 8090 |
|
|
| 24 Jul 2013 01:50 AM |
Monkey is correct.
Just to make it more clear for future reference, there are two MoveTo methods, sharing the same name. One of them moves a model (teleporting one) to a desired location, and the other (walking one) uses the Humanoid to make the object walk to the position instead of instant teleportation.
The one you need to use is the first one, change the MoveTo values instead of moving to a part, move it to a Vector3 location:
Workspace.Player:MoveTo(Vector3.new(0,0,0)) -- Modify to own preferences (use the Player model to move it) |
|
|
| Report Abuse |
|
|