So i looked up a tutorial on how to make a zombie script and used it for a custom alien i made it detects the player but it doesn't move any help? heres the script so you can see it:
torso = script.Parent.Torso range = 20 target = nil function findNearestTarget() plrs = game.Players:GetChildren() for i, plr in ipairs(plrs) do if plr.Character ~= nil then tor = plr.Character.Torso if target ~= nil then if (torso.Position-tor.Position).magnitude < (torso.Position-target.torso.Position).magnitude then break end elseif (torso.Position-tor.Position).magnitude <= range then print(plr.Name.."is in range") break end end end end while true do wait(.1) findNearestTarget() if target ~= nil then script.Parent.Alien:MoveTo(target.Torso.Position) end end