My bad, to prevent errors you may want to do this:
deb = false
TimeBeforeNextDamage = 1 -- in seconds
char.LeftHand.Touched:Connect(function(hit)
if deb == false then
deb = true
local tkdmg = true
local ehum = hit.Parent:FindFirstChild('Humanoid')
if ehum and tkdmg then
tkdmg = false
ehum:TakeDamage(20)
wait(TimeBeforeNextDamage)
end
deb = false
end)
|