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
|
  |
| Joined: 31 Jul 2010 |
| Total Posts: 1633 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 20 Nov 2016 09:17 AM |
Player:WaitForChild("Humanoid")
?????
|
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
Mr_King8
|
  |
| Joined: 31 Jul 2010 |
| Total Posts: 1633 |
|
| |
|
Mr_King8
|
  |
| Joined: 31 Jul 2010 |
| Total Posts: 1633 |
|
| |
|
Mr_King8
|
  |
| Joined: 31 Jul 2010 |
| Total Posts: 1633 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|