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 give a tool an animation?

so I've created this quick animation using a animation that animates the handle but I'm having difficulties exporting that into my tool example can yu halp :)

i tryed to give as much info as possibru

1 answer

Easy! All you have to do is link it and load it into the player! A simple script like this one,

local tool = script.Parent -- Variable to locate the tool
local player = game.Players.LocalPlayer
local character = player.Character

local AnimationAnim = Instance.new("Animation") -- Makes a new Animation instance
AnimationAnim.AnimationId = tool.Handle.YourAnimation.AnimationId -- locates the animation inside of the handle brick
local Animation = character.Humanoid:LoadAnimation(AnimationAnim) -- Puts it into your Humanoid so you can use it!

after you have that done all you need to do is

Animation:Play()

inside where ever you are trying to call the animation.

If you have any questions feel free to ask!

2 comments

0

Thank you for your help but I tried doing this but it wouldn't work maybe I wasn't describing it very good. I was saying I made an animation that use Motor6D to animate the handle okay imma explain it lets say I have a gun I want to like animate some part of the gun to just move around and stuff overall thank you for the help <3

0

Oh! Then what you would have to do is you would have to CFrame the arms I think. I don't have much experience with CFraming and I know it could be a pain. I also don't have much experience with Moter6D. But I do know if it's done right it could look awesome. Sorry!

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