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

Can you answer my Animation question?

Asked by
Nidoxs 190
8 years ago

I have an animation that uses 2 hands however I want to use a tool with the animation but only the left arm will carry out the animation and the right will still hold the tool, how can I fix this? Also here is the content of the local script within the tool.

Tool = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil
local hum = player.Character:WaitForChild("Humanoid")

local animation = Tool.Animation 
local AnimTrack = hum:LoadAnimation(animation) 

Tool.Equipped:connect(function(mouse) 
    mouse.Button1Down:connect(function() 
        AnimTrack:Play()
    end)
end)

Tool.Unequipped:connect(function()
    AnimTrack:Stop()
end)


0
Just an random idea here, but maybe you need to make the equip tool animation not play? magiccube3 115 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Try this

Tool = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil
local hum = player.Character:WaitForChild("Humanoid")

local animation = Tool.Animation 
local AnimTrack = hum:LoadAnimation(animation) 

Tool.Equipped:connect(function(mouse) 
    mouse.Button1Down:connect(function() 
        AnimTrack:Play()
    end)
end) 
Tool.Parent = game.ServerStorage


wait(.1)
Tool.Parent = game.Players.LocalPlayer.Backpack

Not tested, studio is broken for me

0
It will not stop if unequipped because of how I did this. But I can do something else if this doesn't please your fancy fireboltofdeath 635 — 8y
Ad

Answer this question