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: Why won't this work?>:\

Previous Thread :: Next Thread 
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
07 Jul 2012 10:50 PM
There's no output.. it just does nothing o.O


h = game.Workspace["Test Bot"].Humanoid
while true do
wait()
h:MoveTo(h.Parent.Torso.Position + Vector3.new(0,1,0), workspace.Base)
end
Report Abuse
CocoKitten127 is not online. CocoKitten127
Joined: 25 Jun 2012
Total Posts: 137
07 Jul 2012 10:51 PM
h = game.Workscape.Test_Bot.Humanoid
I'm pretty sure that will work.
]
Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
07 Jul 2012 10:53 PM
LOL.. UUhm... no.. It's the function that don't work>.<
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
07 Jul 2012 10:57 PM
h = game.Workspace["Test Bot"].Humanoid
h:MoveTo(Vector3.new(h.Parent.Torso.Position) * Vector3.new(0,1,0))

I am pretty sure thats how you do it. If you use this event on a humanoid, you only need to put in the position and it will move the object untill it reaches its destination. No need for while loop :P

Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
07 Jul 2012 11:01 PM
Lol it's just a chunk from my script, i'm making a bot controller>.< thx i'll see if it works.
Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
07 Jul 2012 11:06 PM
Okay it didn't work. This is what it said in output:

Argument 2 missing or nil
Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
07 Jul 2012 11:18 PM
BUmp?
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
07 Jul 2012 11:23 PM
h = game.Workspace["Test Bot"].Humanoid
h:MoveTo(Vector3.new(h.Parent.Torso.Position) + Vector3.new(0,1,0))

Try that?
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
07 Jul 2012 11:26 PM
In order to move a humanoid like this you need 2 arguments.
h = game.Workspace["Test Bot"].Humanoid
h:MoveTo(Vector3.new(h.Parent.Torso.Position) + Vector3.new(0,1,0),game.Workspace.Base)
Just change the second argument to the part you want to move it to.
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Jul 2012 11:28 PM
A vector3.new takes 3 arguments, hence the Vector'3'.
You give it one, which is
(h.Parent.Torso.Position) + Vector3.new(0,1,0))
Change that line to:
h:MoveTo(Vector3.new((h.Parent.Torso.Position) + Vector3.new(0,1,0), 0, 0))
OR
h:MoveTo(Vector3.new((h.Parent.Torso.Position) + Vector3.new(0,1,0), 0, (h.Parent.Torso.Position) + Vector3.new(0,1,0)))
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Jul 2012 11:29 PM
@White, Vector3.new takes 3 though o.O
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
07 Jul 2012 11:32 PM
@ White


If you use the :MoveTo method on a humanoid, you only need to put in the position, not the part.
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
07 Jul 2012 11:34 PM
Nvm. the MoveTo that I was using makes it walk to the part.
Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
07 Jul 2012 11:52 PM
Okay it kinda works now. But how do I make it KEEP moving, and not just go to the position(0,1.2,0) ._. I have a tool that when you press W it makes the bot move forward.. with the script below.. but it won't KEEP moving, it moves once and stops..


h = script.Parent.Parent.Bot.Value.Humanoid
while true do
wait()
h:MoveTo(Vector3.new(h.Parent.Torso.Position) + Vector3.new(0,1,0),game.Workspace.Base)
end
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