Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a double click function?

Asked by
Noxnuo 11
4 years ago

Yes I know I asked this yesterday but I didnt get a lot of people to help me. And Im kind of confused on where the ticks should go so may I get some help please? And if you get a kind of line I should put in my script can you tell which line number I should put it in? And which script should I put it in?

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)
0
By the way this is for my swords. I want a function to happen with the swords. Noxnuo 11 — 4y
0
Why do you need ticks? AntiWorldliness 868 — 4y

Answer this question