I am trying to add a cooldown to activating the tool, but the variable cd is not updating
this is running in a localscript
script.Parent.Activated:Connect(function()
local cd = false
if cd == false then
local anim = script.Parent.Slash
local hum = char.Humanoid
local track = hum:LoadAnimation(anim)
track:Play()
blocking = false
cd = true
wait(2)
cd = false
end
if cd == true then
end
end)