Normally, when a sword isn't playing an animation, it deals damage. How would I make it only deal damage when the sword animation is activated?
Current Damage Script:
script.Parent.blade.Touched:connect(function(p) if script.Parent.CanDamage.Value == true then script.Parent.CanDamage.Value = false p.Parent.Humanoid:TakeDamage(20) end end)
IsPlaying is a thing.
script.Parent.blade.Touched:connect(function(p) if script.Parent.CanDamage.Value == true and script.Animation.IsPlaying then script.Parent.CanDamage.Value = false p.Parent.Humanoid:TakeDamage(20) end end)