Why the IsAttacking BoolValue's Value doesn't change?
Tool = script.Parent
Damage = script.Parent.Settings.Damage
local ButtonPressed = false
Attacking = script.Parent.Scripts.IsAttacking
Tool.Equipped:connect(function(Mouse)
Mouse.Button1Down:connect(function()
----------------------------------------------------------------------
script.Parent.DamagePart.Touched:connect(function(hit)
if not ButtonPressed then
--is it not pressed?
ButtonPressed = true
Attacking.Value = true -- here
--
--
if hit.Parent then
local human = hit.Parent
hum = human:FindFirstChild("Humanoid")
if hum then
hum.Health = hum.Health - script.Parent.Settings.Damage.Value
else
print("Humanoid Not Found")
end
wait(1)
end
--
Attacking.Value = false -- here
ButtonPressed = false
end
end)
---------------------------------------------------------------------
end)
end)
