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

how to execute an animation in a sword script?

Asked by 6 years ago

I want to use an animation in my sword script. It is unfinished, but I have this much so far:

coolTime = 1 -- time before player may attack again
readytoattack = false -- ignore this variable
tool = script.Parent.Parent

tool.Equipped:connect(function(Mouse)
    readytoattack = true
    Mouse.Button1Down:connect(function()
    damage = math.random(10,15) 
        if readytoattack == true then
            readytoattack = false
        print("text")
        wait(coolTime)
        readytoattack = true
        end
    end)
end)

tool.Unequipped:connect(function()
    readytoattack = false
end)

Answer this question