I attempted to create a Zombie Script where the Zombie follows you and kill you. I made a huge attempt of Scripting the Zombie to follow you but I could not figure out how to get it to kill you. I desperately need assistance on both of those. Below is what I attempted to Script:
local larm = script.Parent:FindFirstChild("Left Arm")
local rarm = script.Parent:FindFirstChild("Right Arm")
distance = script.Parent.Configuration.distance.Value
function findNearestTorso(pos)
local list = game.Workspace:children()
local torso = nil
local dist = distance
local temp = nil
local human = nil
local temp2 = nil
for x = 1, #list do
temp2 = list[x]
if (temp2.className == "Model") and (temp2 ~= script.Parent) then
temp = temp2:findFirstChild("Right Arm")
human = temp2:findFirstChild("Humanoid")
if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
if (temp.Position - pos).magnitude < dist then
torso = temp
dist = (temp.Position - pos).magnitude
end
end
end
end
return torso
end
while true do
wait(math.random(1,1))
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position, target)
end
end

8 comments
code block pls
Edited to add code block.
<3
Sorry, it is difficult to add. I am new here!
In the future -- select all of your code, and press the Lua button above the text box. A line of ~~~ will appear before and after the code.
Thanks.
Why are you doing 'wait(math.random(1, 1))
I forget. I was trying to make it work for a very long time and I was getting very stressed and depressed.