I am making a zombie and have written in this script to make it follow me but it does not. I can push it around but no follow like I said. Here is the script to move:
while true do wait (.1) findNearestTorso() if target~= nil then script.Parent.Humanoid:MoveTo(target.Torso.Position,target.Torso) end end
What is wrong?
Assuming 'findNearestTorso return a target, that you want to follow.
while true do wait (.1) local target = findNearestTorso() if target~= nil then script.Parent.Humanoid:MoveTo(target.Torso.Position,target.Torso) end end
According to the code you provided, 'target' was nil so it technically never ran the line under it.
Please upvote if this work.