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

How to insert animations into specific tools?

How would I insert specific animations into tools, such as a bomb, I made a throwing animation but how do I get it to work?

P.S. Im new to animations

3 comments

0

Just make the animation run when you click, or equip the tool, or whatever. http://wiki.roblox.com/index.php?title=Animations

0

Im sorry again im new, how would I do that, thats the question..

0

you read the wiki and learn it and practice it

1 answer

Tool = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil
local hum = player.Character:WaitForChild("Humanoid")
local animation = script.Parent.ExportAnim --Change DanceAnim to the name of your animation.
local AnimTrack = hum:LoadAnimation(animation) --Loads the animation into the humanoid.
Tool.Activated:connect(function(mouse) --If you're using a tool, change Selected to Activated, and get rid of the code on the next line. Otherwise, keep this the same.
        AnimTrack:Play()
    end)
end)
Tool.Unequipped:connect(function() --If you're using a tool, change Deselected to Unequipped. Otherwise keep it the same.
    AnimTrack:Stop()
end)

How do I get this script to play when I use the tool?

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