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

What's wrong with my sword script?

Asked by 10 years ago

There is a little part in my script and there is a really dumb error that isn't making my sword

tool.Activated:connect(function()
    local clickdelta = tick() - lastclick
    if clickdelta > swingtime  then
        lastclick = tick()
        hithumanoids = {}
        if clickdelta < swingtime + conbowindow then
            combo = (combo + 1) % 3
        else
            combo = 0
        end
        if player then
            if combo == 0 then
                event:FireClient(player, "RunAnimation", "SlashAnim2")
                slashsound:Play()
            elseif combo == 1 then
                event:FireClient(player, "RunAnimation", "ThrustAnim2")
                overheadsound:Play()
            elseif combo == 2 then
                event:FireClient(player, "RunAnimation", "OverheadAnim2")
                lungesound:Play()
                end
            end
        end
    end)
end)

Error: ')' expected (to close '(' at line 33 near 'end')*

*33 was supposed to be the start of the code.

1 answer

Log in to vote
0
Answered by 10 years ago

Change

             end
            end
        end
    end)
end)

to

             end
            end
        end
    end
end)

You had one too many ')'s.

0
Still doesn't work. It still has a error thing under the last. FancyFame 15 — 10y
Ad

Answer this question