I just need a simple debounce of 2 seconds, i tried to do it myself but i'm a bit special so yea
local tool = script.Parent.Parent --your tool
local toolActive = false
local damage = 1
local duration = 2
local function onTouched(hit)
if not toolActive then do return end end
local Humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
if Humanoid then
Humanoid:TakeDamage(damage)
end
end
local function onActivated()
if toolActive then do return end end
toolActive = true; wait(duration); toolActive = false
end
script.Parent.Touched:Connect(onTouched)
tool.Activated:Connect(onActivated)

1 comment
use a server-side script