Can I add a function for a play when the player clicks twice during a specific time?
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:
1 | script.Parent.DamagePart.Touched:Connect( function (p) |
2 | if script.Parent.CanDamage.Value = = true then |
3 | script.Parent.CanDamage.Value = false |
4 | p.Parent.Humanoid:TakeDamage( 20 ) |
6 | script.Parent.CanDamage.Value = true |
My Local script for animations:
03 | script.Parent.Equipped:Connect( function () |
04 | local Idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) |
05 | local Slash = script.Parent.Parent.Humanoid:LoadAnimation(script.Slash) |
10 | script.Parent.Activated:Connect( function () |
11 | local Idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) |
12 | local Slash = script.Parent.Parent.Humanoid:LoadAnimation(script.Slash) |
14 | if CanAttack = = true then |
22 | script.Parent.CanDamage.Value = true |
I want the function to happen in the script for Attacking. Advice is all taken, Thanks!