Hello, yes I asked the question 3 times. But I still dont know where I should put a double click function, and i dont know how I should make my double click function! Help?
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(10)
wait(0.8)
script.Parent.CanDamage.Value = true
end
end)
My LocalScript:
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(0.8)
Slash:Stop()
Idle:Play()
CanAttack = true
script.Parent.CanDamage.Value = true
end
end)
