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

How to put an animation in a tool? *NEED IMMEDIATE HELP*

I'm having problems putting my custom animation into a tool without a handle. Every time I open it, it plays the animation, but when I move a little, it will stop. Then it won't play again. Here is my script for my frontpike (which works fine) :

Tool = script.Parent local player = game.Players.LocalPlayer repeat wait() until player.Character ~= nil local hum = player.Character:WaitForChild("Humanoid")

local animation = Tool.Front local AnimTrack = hum:LoadAnimation(animation)

Tool.Activated:connect(function(mouse) AnimTrack:Play() end)

Tool.Unequipped:connect(function() AnimTrack:Stop() end)

Here is my script for my front timber (has the problems I explained earlier.):

Tool = script.Parent local player = game.Players.LocalPlayer repeat wait() until player.Character ~= nil local hum = player.Character:WaitForChild("Humanoid")

local animation = Tool.FrontTimber local AnimTrack = hum:LoadAnimation(animation)

Tool.Activated:connect(function(mouse) AnimTrack:Play() end)

Tool.Unequipped:connect(function() AnimTrack:Stop() end)

I really need this to be solved as fast as possible.

1 comment

0

Please use the lua button and paste the code in there. I'd be much easier for me to read!

1 answer

Your problem is most likely occurring because the animation for walking overwrites your custom animation. To fix this, you can make your animstion priority higher.

After the line

local AnimTrack = hum:LoadAnimation(animation)

Try adding the line

AnimTrack.Priority = Enum.AnimationPriority.Action

1 comment

0

Thank you so much!

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