Code not doing any damge?
local tool = script.Parent
local canDamage = false
local function onTouch(otherPart)
local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
if not humanoid then
return
end
if humanoid.Parent ~= tool.Parent and canDamage then
humanoid:TakeDamage(55)
else
return
end
canDamage = false
end
local function slash()
canDamage = true
end
tool.Activated:Connect(slash)
tool.Handle.Touched:Connect(onTouch)
How can I fix it?
Nothing is in the output?