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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Should this work? (Follow script)

Previous Thread :: Next Thread 
LOBOT44 is not online. LOBOT44
Joined: 03 Feb 2010
Total Posts: 23539
14 Jul 2012 04:01 PM
while true do
wait(0.1)
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position, target)
end
end
Report Abuse
supercheese200 is not online. supercheese200
Joined: 08 Dec 2009
Total Posts: 235
14 Jul 2012 04:02 PM
As long as you have declared you findNearestTorso function...
Report Abuse
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
14 Jul 2012 04:02 PM
Yeah, but it will be very close to them or inside them.
Report Abuse
LOBOT44 is not online. LOBOT44
Joined: 03 Feb 2010
Total Posts: 23539
14 Jul 2012 04:02 PM
How do i declare it?
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
14 Jul 2012 04:07 PM
You write a function and fill in the code...?

function findNearestTorso(...arguments...)
...some code here...
end
Report Abuse
LOBOT44 is not online. LOBOT44
Joined: 03 Feb 2010
Total Posts: 23539
14 Jul 2012 04:10 PM
function findNearestTorso(Position,MoveTo)
while true do
wait(0.1)
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position, target)
end
end
end
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
14 Jul 2012 04:13 PM
No, you didn't write any code to find the nearest torso.
Report Abuse
LOBOT44 is not online. LOBOT44
Joined: 03 Feb 2010
Total Posts: 23539
14 Jul 2012 04:14 PM
wl, heck with this. i'll just go to free models.
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