✓ Accepted answer
Hello.
The reason as to why your animation is looping is either, you set the wrong animation priority, or, you haven't told it to stop the animation when you unqeuipped your tool. This is very simple to do with the .Unequipped function. This function will call anytime the tool is unequipped. From there, we can tell the tool to stop the animation. I also reccomend to Load the animation before you activate the tool, and also use the Humanoid.Animator instead of just the humanoid, as that is deprecated.
Here is an example with your script:
local Tool = script.Parent
local ToolAnimation = Tool.Animation
local Character = Tool.Parent
local Humanoid = Character.Humanoid
local Animation = Humanoid.Animator:LoadAnimation(ToolAnimation)
Tool.Activated:Connect(function()
Animation:Play()
end)
Tool.Unequipped:Connect(function()
Animation:Stop()
end)
Hope this helps!
1 comment
Thanks Mate!