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

Help With Chase And Target Script?

Asked by
Scootakip 299 Moderation Voter
8 years ago
script.Parent.MouseButton1Click:connect(function(lool)
    for i,v in pairs(game.Players:GetChildren()) do
        if v.Name == script.Parent.Parent.NameHere.Text then
            for i,z in pairs(game.Workspace.Zombies:GetChildren()) do
                if z.Owner.Value == script.Parent.Parent.Parent.Parent.Parent.Parent.Name then
                    z.ZMode.Value = "Attack"
                    while v.Character.Humanoid.Health ~= 0 do
                        z.Zombie:MoveTo(v.Character.Torso.Position)
                    end
                end
            end
        end
    end
end)

This script is basically supposed to make the zombie chase own the person who's name is entered in the Name text box until their health = 0

The problem is that this doesn't work. The script works up to the part where it's actually supposed to go to the target but then doesn't do anything. Also, no error messages, help?

Answer this question