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

How do I add custom animation to tool?

Asked by 7 years ago

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

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago
--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)
0
Can you make it so that it only plays when you are holding it? animelover6446 wolfbarrier123 -25 — 7y
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 animelover6446 41 — 7y
Ad

Answer this question