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 » Scripters
Home Search
 

Re: MoveTo for playable character

Previous Thread :: Next Thread 
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
19 Nov 2016 03:29 PM
Help I am trying to make a script to move my self from A to B

I tried to use MoveTo but my player don't move e.e

I tried to use Cframe but the player walking animations don't kick in..


Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
19 Nov 2016 03:34 PM
bumpp



Report Abuse
XandertjeKnal is not online. XandertjeKnal
Joined: 25 Feb 2016
Total Posts: 543
19 Nov 2016 03:40 PM
Teleportation:

Try to set the CFrame of the player's HumanoidRootPart to the CFrame/Position of B.
An example:
game.Workspace.Mr_King8.HumanoidRootPart.CFrame = game.Workspace.PartB.CFrame + CFrame.new(0, 4, 0)
If I didn't make mistakes that script should teleport you slightly above PartB.


Walking/Moving:
Example:
game.Workspace.Mr_King8.Humanoid.WalkToPoint = game.Workspace.PartB.Position


Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 08:51 AM
That's not working for me.

I edited it to find the player

script.Parent.MouseButton1Click:connect(function()

game.Workspace.Camera.Customizing.Humanoid.WalkToPoint = game.Workspace.PartB.Position

end)

The game I am using it for ( Code 963 )
https://www.roblox.com/games/127451455/Game-that-has-no-name




Report Abuse
konlon15 is not online. konlon15
Joined: 09 Oct 2014
Total Posts: 903
20 Nov 2016 08:54 AM
if this is in a local script, then change this

script.Parent.MouseButton1Click:connect(function()
game.Workspace.Camera.Customizing.Humanoid.WalkToPoint = game.Workspace.PartB.Position
end)

to

script.Parent.MouseButton1Click:connect(function()
game.Players.LocalPlayer.Humanoid.WalkToPoint = game.Workspace.PartB.Position
end)

if it's not, you need to think about the way you get your input
Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 09:13 AM
It is a local script the Output error is this

15:13:08.645 - Humanoid is not a valid member of Player
15:13:08.646 - Stack Begin
15:13:08.646 - Script 'Players.Player1.PlayerGui.PlayerCust.Frame.Boy.FrameForBoy.Boy.LocalScript', Line 2
15:13:08.647 - Stack End


Report Abuse
PeterTheCoder is not online. PeterTheCoder
Joined: 17 Feb 2016
Total Posts: 48
20 Nov 2016 09:17 AM
Player:WaitForChild("Humanoid")


?????


Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 09:22 AM
Its in a GUI don't think I need to wait..


Report Abuse
PeterTheCoder is not online. PeterTheCoder
Joined: 17 Feb 2016
Total Posts: 48
20 Nov 2016 09:23 AM
Oh...


Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 09:30 AM
Bump


Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 09:36 AM
Bumping


Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 10:19 AM
bump


Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
20 Nov 2016 11:03 AM
local target = part.Position

repeat
wait()
Humanoid:MoveTo(target)
until (target-torso.Position).magnitude<=3


Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil)
Report Abuse
Egroce is not online. Egroce
Joined: 06 Jul 2010
Total Posts: 27
20 Nov 2016 11:56 AM
Players don't have humanoids, characters do.
Characters are located in the workspace, and is the character you control in-game.
You need to get the character from the player, then script from there.

Example:


player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent --Or wherever your player is at.
char = player.Character

script.Parent.MouseButton1Click:connect(function()
char.Humanoid.WalkToPoint = game.Workspace.PartB.Position
end)
Report Abuse
Egroce is not online. Egroce
Joined: 06 Jul 2010
Total Posts: 27
20 Nov 2016 12:02 PM
lol whoops, i just realized an easier way to do that.


Replace:

player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent

with:

player = game.Players.LocalPlayer
Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 12:47 PM
18:47:26.649 - Humanoid is not a valid member of Model
18:47:26.650 - Stack Begin
18:47:26.650 - Script 'Players.Player1.PlayerGui.PlayerCust.Frame.Boy.FrameForBoy.Boy.LocalScript', Line 5
18:47:26.651 - Stack End


Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
20 Nov 2016 12:49 PM
@Mr.

Please tell me you're trying to find the Humanoid inside of the Character and not the Player.


Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil)
Report Abuse
Mr_King8 is not online. Mr_King8
Joined: 31 Jul 2010
Total Posts: 1633
20 Nov 2016 12:53 PM
the player model is in the cam

and I got that error from using that nice dudes code


Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
20 Nov 2016 01:42 PM
try this:

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
repeat
wait()
char:WaitForChild('Humanoid'):MoveTo(target.Position')
until (char.Torso.Position-target.Positon).magnitude<=5


Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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