generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: :MoveTo Problems [READ!]

Previous Thread :: Next Thread 
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
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
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
24 Jul 2013 12:38 AM
D:
Report Abuse
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
24 Jul 2013 12:44 AM
Anyone?
Report Abuse
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
24 Jul 2013 12:53 AM
Anyone?
Report Abuse
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
24 Jul 2013 01:10 AM
Anyone D:
Report Abuse
QuFileC is not online. QuFileC
Joined: 19 Feb 2013
Total Posts: 49
24 Jul 2013 01:11 AM
What are you talking about?
Report Abuse
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
24 Jul 2013 01:13 AM
Teleporting to a part
Report Abuse
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
24 Jul 2013 01:19 AM
O. o
Report Abuse
6e8 is not online. 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
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
24 Jul 2013 01:26 AM
pchar is all the players
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image