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

How can I make the IdleAnimation run with my tool equipped?

Asked by 9 years ago

After the EquipAnimation is over, the arm holding the tool goes back to holding the tool the default way instead of running my Idle script, but the other arm is affected by the animation. Any way I can make the animation run on both arms even though the tool is equipped? (Yes, I have made the animation work for both arms)

function equippistol()
    humanoid = tool.Parent:FindFirstChild("Humanoid")
    if humanoid then
        local anim = tool:FindFirstChild("IdleAnim")
        if anim and humanoid then
            if loadedidleanim then
                loadedidleanim:Stop()
            end
            loadedidleanim = humanoid:LoadAnimation(anim)
            if loadedidleanim then
                loadedidleanim:Play()
            end
        end
        local anim = tool:FindFirstChild("EquipAnim")
        if anim and humanoid then
            local loadedanim = humanoid:LoadAnimation(anim)
            if loadedanim then
                loadedanim:Play()
            end
        end
    end
end

function unequippistol()
    if loadedidleanim then
        loadedidleanim:Stop()
    end
    local anim = tool:WaitForChild("UnEquipAnim")
    if  humanoid and anim then
        local loadedanim = humanoid:LoadAnimation(anim)
        if loadedanim then
            loadedanim:Play()
        end
    end
end

Thank you for any help!

1 answer

Log in to vote
1
Answered by 9 years ago

Equipped arm is on right arm, check it, the left arm is probably affected, so you should change idleanim and remove left arm's animation, and make sure the pistol tool has IdleAnim of your Anim ID.

Ad

Answer this question