It’s happening because it’s destroying it many times, so when the condition is met, even if it’s destroyed, it’ll still try to destroy it, and thus will try to destroy nil. I would recommend setting up a Died event on the humanoid so when the zombie is dead, destroy them
local hum = script.Parent
hum.Died:Connect(function()
hum.Parent:Destroy()
end)
If there’s an event that can prevent an unneeded infinite while loop, use it. It should be what is needed for you since you were originally destroying the humanoid only, instead of the entire player