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

How do I add custom animation to tool?

How do I add a custom animation to my tool? I am scripting a cafe and I made the model and tool for my cup and made the animation. How do I make it so that when the player is holding it, and you click, it plays the animation? Please help! <3

1 answer

--This is for when you have it equipped and click with it

local Tool = script.Parent
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" --Replace with your animation
Tool.Activated:connect(function()
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()
end)
--This is for when you equip it and nothing else

local Tool = script.Parent
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" --Replace with your animation
Tool.Equipped:connect(function()
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()
end)

2 comments

0

Can you make it so that it only plays when you are holding it? animelover6446

0

This makes it so when you click when the tool is equipped then the animation plays. I will edit the answer above for what you might be looking for

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