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
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
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.
3 comments
Just make the animation run when you click, or equip the tool, or whatever. http://wiki.roblox.com/index.php?title=Animations
Im sorry again im new, how would I do that, thats the question..
you read the wiki and learn it and practice it