Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to implement animations into a tool?

Recently I made a few animations for swords. I wanted to know how to get certain animations to play when the tool is in and out of your inventory. I would also know how I could play an animations that gives me the tool such as taking a sword/gun off my back and then being able to put it back on.

1 answer

heres how I do it:

insert a local script into your tool and insert your animations into the local script

assuming an animation is called "attack":

script.Parent.Activated:Connect(function()
   local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.attack)

   attack:Play()
   wait(1) -- duration of animation 
   attack:Stop()
end)

and you can do the same for tool.Equipped and tool.Unequipped, using your defined animations

the secret is that it gets put in your backpack and calling script.Parent.Parent gets the character

script.Parent = backpack

backpack.Parent = character

This discussion is preserved as it was. New answers, comments, and votes are closed.