So I am trying to make an NPC that kills you then makes you into a zombie but when I try to do this it just keeps cloning the player over and over again. No error prints
local debounce = false
script.Parent.HumanoidRootPart.Touched:Connect(function(Touch)
if Touch.Parent:FindFirstChild("Humanoid") ~= nil and debounce == false then
debounce = true
wait(1)
Touch.Parent.Humanoid.Health = 0
local clone = Touch.Parent:Clone()
clone.Parent = game.Workspace
clone.Name = "Zombie"
wait(5)
debounce = false
end
end)

1 comment
It does work but doesn't work for some reason on players