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: Follow script Help

Previous Thread :: Next Thread 
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 03:18 PM
This is part of a Monster's Follow script:

while true do
wait(math.random(1,5))
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
script.Parent.Zombie:MoveTo(target.Position, target)
end

end

I want to know why the Zombe dosn't move straight towards the NearestTorso's position. Can anyone explain?
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
22 Aug 2012 03:19 PM
maybe too much waiting?

† KMXD 2.0 †
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 03:20 PM
No, it moves correctly. I want to know the reason for it doing it successfully. I apologize for the fact that this is a Free Model. I am trying to understand it.
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
22 Aug 2012 03:21 PM
It basically just checks for torsos in the dist, which is 100.

Θ_Θ Sage Mode!
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 03:23 PM
But why dosn't it teleport to the nearest torso? To me thats what it looks like it should do.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:24 PM
The :MoveTo() method will make the zombie walk there.

† KMXD †
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
22 Aug 2012 03:25 PM
I don't know myself, I've never invented with Humanoid commands.

Θ_Θ Sage Mode!
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 03:26 PM
@KnightMare it does? I didn't know that.
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
22 Aug 2012 03:26 PM
:WalkTo(thing) Teleports it there. WalkTo(position, thing) will actually make it walk.
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
22 Aug 2012 03:26 PM
Hmm, this is what object browser says,

void MoveTo(Vector3 location, Instance part)
Member of Humanoid
Summary:
Attempts to move the Humanoid and it's associated character to 'part'. 'location' is used as an offset from part's origin.

Θ_Θ Sage Mode!
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
22 Aug 2012 03:27 PM
Ahah! I know how it works, zombies have humanoids called "Zombie" so it's using the humanoid, I was practically right o.o

Θ_Θ Sage Mode!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:28 PM
Theres no walkto, its moveto. MoveTo with models will make it instantly "teleport", but with Humanoids, make the model walk there.

† KMXD †
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
22 Aug 2012 03:29 PM
Oops, yeah MoveTo(). IIRC tho, there is a walkto()
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
22 Aug 2012 03:31 PM
MoveTo()
Functions like this in model:

void MoveTo(Vector3 location)
Member of Model
Summary:
Moves the centroid of the Model to the specified location, respecting all relative distances between parts in the model.

Θ_Θ Sage Mode!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:33 PM
Oh, look, my fanalt can copy/paste. :D

† KMXD †
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
22 Aug 2012 03:35 PM
I'm not your fanalt anymore, you dislike me. :(

Θ_Θ Sage Mode!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Aug 2012 03:35 PM
not true D:

† KMXD †
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 03:49 PM
Thanks guys!
Report Abuse
jmr11b is not online. jmr11b
Joined: 19 Aug 2010
Total Posts: 806
22 Aug 2012 04:02 PM
So why dosn't this make it move:
while true do
spawn = game.Workspace.SpawnLocation
script.Parent.Zombie:MoveTo(spawn.Position, spawn)
wait(1)
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