it doesn't wait 1 second before touching again. Whats wrong ?
workspace[plr.Name.."Skills"].BallAttack.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") local clicked = false if hum and clicked == false then clicked = true hum:TakeDamage(10) print("Killing!") wait(1) clicked = false end end)
The local value clicked is stored within the function's scope, meaning that it will not wait 1 second because every time the function is ran, it is set to be false, or something (i suck at explaining stuff.). Heres the fixed version:
clicked = false workspace[plr.Name.."Skills"].BallAttack.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChildWhichIsA("Humanoid") if hum and clicked == false then clicked = true hum:TakeDamage(10) print("Killing!") wait(1) clicked = false end end)