Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How to make a following script?

Asked by 8 years ago

I've been trying to make a follow script for a zombie game but it just won't follow. I am also using a mesh (not charactermesh) so i think thats the problem. This is the code i made to make it move:

script.Parent:MoveTo(game.Players.Character.Torso)

But it still doesn't move! I need help. NOTE: I did not anchor it

0
Try adding .Position after Torso. And then you might also want to loop this in a while true do loop. Just because the player's Torso position can change a lot. Also, is the script inside the Humanoid of the zombie. MoveTo is a function only Humanoids can access.  User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by
crome60 43
8 years ago

Wait, you said that you're using a mesh, by that did you mean that you're just using one part? Not a humanoid? The script that you're attempting would require the parent to have a humanoid. If it's a singular part without a humanoid inside it, then :MoveTo() wouldn't work. Also, that line of code would probably need to be looped if you wanted the zombie to continually chase the player.

If you're only using one part and you want to have that part chase the player, this is a pretty good tutorial: http://wiki.roblox.com/index.php?title=Scripting_Book/Chapter_3

As a reminder, MoveTo() should only be used when the parent of the script has a Humanoid.

Ad

Answer this question