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

Right Leg can do damage by itself without playing the animation?

Asked by
ekweji 4
7 years ago

My problem is, i'm making an animation that can do damage but it works without animation which I don't want:

mouse.KeyDown:connect(function(key)
    if key == "e" and True then
        True = false
        local aT1 = hum:LoadAnimation(anim)
        aT1:Play()

        animSound:Play()
        RightArm.Touched:connect(function(hit)
            local h = hit.Parent:FindFirstChild("Humanoid")
                if h then
            h:TakeDamage(20)

        wait(3)
        True = true
        end
        end)
    end
end)

1 answer

Log in to vote
0
Answered by
farrizbb 465 Moderation Voter
7 years ago
Edited 7 years ago

I ran into this thing before you need to return the hit after the animation finished

mouse.KeyDown:connect(function(key)
    if key == "e" and True then
        True = false
        local aT1 = hum:LoadAnimation(anim)
        aT1:Play()
        animSound:Play()
        RightArm.Touched:connect(function(hit)
            local h = hit.Parent:FindFirstChild("Humanoid")
                if h then
            h:TakeDamage(20)
        wait(3)
    return hit
        True = true
        end
end)
end
end)

If this worked then please accept this answer

0
np farrizbb 465 — 7y
0
Players.Player1.Backpack.CharacterAnimationScript:22: 'end' expected (to close 'if' at line 19) near 'wait' all ends are there?? ekweji 4 — 7y
0
show me the animation script farrizbb 465 — 7y
Ad

Answer this question