local zombie = script.Parent
local zombieHuman = zombie:WaitForChild(“HumanoidRootPart”)
local hitbox = zombie:WaitForChild(“HitBox”)
local damage = 30
hitbox.Touched:Connect(function(hit)
if hit.Parent then
local human = hit.Parent:FindFirstChild(“Humanoid”)
if human and hit.Parent.Name ~= “Zombie” then
human.Health = human.Health - 5
end
if hit.Name == "Bullet" then
zombieHuman.Health = zombieHuman.Health - damage
hit:Destroy()
if zombieHuman.Health <= 0 then
_G.deadZombies = _G.deadZomb + 1
zombie:Destroy()
end
end
end
end)
local ServerStorage = game:GetService(“ServerStorage”)
local Humanoid = ServerStorage.Zombie.Humanoid
while wait(1) do
Humanoid:MoveTo(game.Workspace[“2_P90”].Humanoid.Position)
end
I fixed it! all i did was this
local zombieHuman = zombie:WaitForChild(“Humanoid”)
local zombieHumanRootPart = zombie:WaitForChild(“HumanoidRootPart”)
and also this
while wait(1) do
zombieHuman:MoveTo(game.Workspace[“2_P90”].HumanoidRootPart.Position)