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

Custom animations on a sword dont fully work?

Asked by 6 years ago

I created a custom sword and sword script and it works. But when the custom animation runs his right arm doesnt follow the animation.

So you know how if you have a non animated tool and your arm just sticks out at a 90 degree angle. Thats what the players arm is doing but the rest of the body is animated. I know this probably isnt the site for this sorta question but I figured it could have to do with the script so I decided to ask it here. I want the tool to be equipped and his right arm to still play the animation. Ive seen it done before on other games so It must be possible.

local CanAttack = true
local player = game.Players.LocalPlayer

script.Parent.Equipped:connect(function()
    local character = player.Character
    local animateScript = character.Animate
    animateScript.idle.Animation1.AnimationId = 'http://www.roblox.com/asset/?id=1083822467' -- This is the animation that I am testing

    local attack1 = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack1)
    local attack2 = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack2)
    local attack3 = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack3)
end)

script.Parent.Activated:connect(function()
    local attack1 = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack1)
    local attack2 = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack2)
    local attack3 = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack3)

    if CanAttack == true then
        local animationchoice = math.random(1,3)
        if animationchoice == 1 then
            attack1:Play()
            CanAttack = false
            wait(1) -- Wait however many seconds long the attack animation is
            attack1:Stop()
            CanAttack = true
            script.Parent.CanDamage.Value = true
        end
        if animationchoice == 2 then
            attack2:Play()
            CanAttack = false
            wait(1) -- Wait however many seconds long the attack animation is
            attack2:Stop()
            CanAttack = true
            script.Parent.CanDamage.Value = true
        end
        if animationchoice == 3 then
            attack3:Play()
            CanAttack = false
            wait(1) -- Wait however many seconds long the attack animation is
            attack3:Stop()
            CanAttack = true
            script.Parent.CanDamage.Value = true
        end
    end
end)
0
its not in the animation script, its in the sword script. SyndicateHalo 40 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I think you might have animated it with R6 or R15 so animate with the one you use

Ad

Answer this question