Here's the script in my sword:
script.Parent.Parent.Equipped:Connect(function() script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent.Name ~= script.Parent.Parent.Parent.Name then if script.Parent.Parent.CanDamage.Value == true then hit.Parent.Humanoid:TakeDamage(22) end end end end) end)
No errors pop up or nothing :v
First of all I recommend using a debounce within a script and not a value. And that’s basically all I can say because you didn’t really organize your script very well and it’s hard to know where everything is. Trying editing it and adding variables for most of the things. Also when you say if canDamage.value == true then u want to change canValue to false so it doesn’t damage the player over and over again. And the after a few seconds set it back to true. But yeah I would recommend a debounce within a script.