function onTouched(hit)
wait(1) -- I added the wait in hopes to have the zombie not infinitely hit the player.
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
human.Health = human.Health - 1
end
end
script.Parent.Touched:connect(onTouched)
This script is supposed to deduct damage from the player and wait a second before hitting them again. I added the wait in there in hopes to make the enemy not infinitely hit the player, but it still does. Can someone tell me what I'm doing wrong? Thanks.
