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

How do I add animations to Tools?

Asked by
proo34 41
5 years ago

I have a gun that I want to have a reload animation for. I can't seem to find a way to make the animation work. Can anyone tell me how to make an animation play in a tool? Thanks!

1 answer

Log in to vote
0
Answered by 5 years ago

You probably already know how to make an animation, and probably made one before. So to make an animation play (the simple way): insert an animation in the tool give the id the id of your animation

script (localscript):

local t = script.Parent
local an = t.Animation --any name will do
local hum = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

local animation = hum:LoadAnimation(an)

animation.Looped = true -- true or false

t.Activated:Connect(function()
animation:Play()
end)

now this is the way that its supposed to be. for like an gun you have to do alot of stuff, but i think you know how to confiure this script.

Ad

Answer this question