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: Ugh, why won't this move

Previous Thread :: Next Thread 
iPremiumZ is not online. iPremiumZ
Joined: 23 Jan 2012
Total Posts: 6834
03 Apr 2012 09:29 PM
This script is inside of an AI


bin = script.Parent
h = bin.Humanoid


while true do
wait(5)
h:MoveTo(Vector3.new(1.5, 61.4, 4)
end

Report Abuse
Contemptus is not online. Contemptus
Joined: 27 Mar 2012
Total Posts: 368
03 Apr 2012 09:35 PM
ww
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
03 Apr 2012 09:42 PM
The :MoveTo() only has the one bracket for the Vector3.new, and doesn't have the second.

bin = script.Parent
h = bin.Humanoid


while true do
wait(5)
h:MoveTo(Vector3.new(1.5, 61.4, 4))
end
Report Abuse
Eyin is not online. Eyin
Joined: 10 Oct 2009
Total Posts: 567
03 Apr 2012 09:43 PM
Because you're calling MoveTo on a humanoid, you need two arguments. One Vector3 and one instance.

:MoveTo(V3, Part)
Report Abuse
Contemptus is not online. Contemptus
Joined: 27 Mar 2012
Total Posts: 368
03 Apr 2012 11:45 PM
@ Eyin, could I do this?

bin = script.Parent
h = bin.Humanoid
t = bin.Torso


while true do
wait(5)
h:MoveTo(Vector3.new(1.5, 61.4, 4))
t:MoveTo(Vector3.new(1.5, 61.4, 4))
end
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
03 Apr 2012 11:49 PM
The 2nd moveto argument is optional, but whatever.

bin = script.Parent
h = bin.Humanoid
t = bin.Torso


while true do
if h.Postion ~= Vector3.new(1.5,61.4,4) then
wait(5)
h:MoveTo(Vector3.new(1.5, 61.4, 4), game.Workspace.Base)
end
end
Report Abuse
Eyin is not online. Eyin
Joined: 10 Oct 2009
Total Posts: 567
04 Apr 2012 07:49 AM
I doubt you could do it like that, Contemptus. Since you don't know the part, just ray cast.


bin = script.Parent
h = bin.Humanoid
t = bin.Torso
local pos = Vector3.new(1.5, 61.4, 4)
local ray = Ray.new(pos, Vector3.new(0,-1) * 25)
local part = Workspace:FindPartOnRay(ray, bin)


while wait(5)do
h:MoveTo(pos, part)
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