Zombie NPC is getting stuck on the stairway rail.. I tried adding an invisible part on the rail and it didn't do anything. I tried changing the size a bit, but it screwed up the entire pathfinding.
local PathfindingService = game:GetService("PathfindingService")
local zomb = script.Parent
local humanoid = zomb.Humanoid
local maxDistance = 1000
-- part is the player character
function dmg(part)
local debounce = false
if not debounce then
local animation = humanoid:LoadAnimation(zomb.attack)
debounce = true
part.Humanoid:TakeDamage(45)
animation:Play()
wait(1)
debounce = false
end
end
while wait(.2) do
for i,plr in pairs(game.Players:GetPlayers()) do
if plr:DistanceFromCharacter(zomb.HumanoidRootPart.Position) < maxDistance then
player = plr
part = plr.Character
end
end
local path = PathfindingService:CreatePath()
if part then
path:ComputeAsync(zomb.HumanoidRootPart.Position, part.HumanoidRootPart.Position)
local waypoints = path:GetWaypoints()
for i,v in pairs(waypoints) do
humanoid:MoveTo(v.Position)
humanoid.MoveToFinished:Wait()
if player:DistanceFromCharacter(zomb.HumanoidRootPart.Position) < 5 then
dmg(part)
end
end
end
if humanoid.Health <= 0 then
script:Destroy()
end
end

3 comments
It did work, but occasionally the zombie stops for 8 seconds (the timeout) and then continues. Also, zombies still get stuck sometimes.
it's just roblox's dodge shit pathfinding
Ah, ok.