i am working on a zombie i dont know how to make a zombie that can brake stuff liek wood or doors something like that
local debounce = false
local wood = script.Parent
local woodHuman = wood:WaitForChild("Humanoid")
wood.Touched:Connect(function(hit)
if debounce then
return
end
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name == "Zombie" then
debounce = true
woodHuman:TakeDamage(20)
task.wait(5) --cooldown
debounce = false
end
end)
woodHuman.HealthChanged:Connect(function(health)
if health <= 0 then
wood.CanCollide = false
wood.Transparency = 1
end
end)
2 Likes
Thank you it worked i hade to change some stuff