So I have a sword that I made. It plays the animation perfectly but it deals no damage when I use it. There are no errors or warnings. Here is the Local Script in the tool's handle:
repeat wait() until game.Players.LocalPlayer.Character
script.Parent.Parent.Equipped:Connect(function()
local Anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
script.Parent.Parent.Activated:Connect(function()
Anim:Play()
script.Parent.Parent.Damage.Value = true
wait(1)
Anim:Stop()
script.Parent.Parent.Damage.Value = false
script.Parent.Parent.Debounce.Value = true
end)
end)
The Local Script works fine, but the Server Script in the sword's blade doesn't:
local db = script.Parent.Parent:WaitForChild("Debounce")
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name == script.Parent.Parent.Parent.Name then
else
if script.Parent.Parent.Damage.Value == true then
if db.Value == true then
db.Value = false
hit.Parent.Humanoid:TakeDamage(2)
end
end
end
end
end)
I followed a Youtube tutorial for this and just made a few modifications to their scripts.
Could someone please point out what I am doing wrong?

2 comments
whats the default value of your debounce
true