I there so i need some help with a kind of a double click function. When the player clicks once the sword will slash or just normal swing and for the double click the sword will turn 90 degrees and hit the player. Does anyone know what I should do Thanks!
Here is my script for Attacking:
script.Parent.DamagePart.Touched:Connect(function(p) if script.Parent.CanDamage.Value == true then script.Parent.CanDamage.Value = false p.Parent.Humanoid:TakeDamage(20) wait(1) script.Parent.CanDamage.Value = true end end)
My Local script for animations:
local CanAttack = true script.Parent.Equipped:Connect(function() local Idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) local Slash = script.Parent.Parent.Humanoid:LoadAnimation(script.Slash) Idle:Play() end) script.Parent.Activated:Connect(function() local Idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) local Slash = script.Parent.Parent.Humanoid:LoadAnimation(script.Slash) if CanAttack == true then Slash:Play() Idle:Stop() CanAttack = false wait(1) Slash:Stop() Idle:Play() CanAttack = true script.Parent.CanDamage.Value = true end end)
I want the function to happen in the script for Attacking. Advice is all taken, Thanks!