my code:
local Tool = script.Parent
local Player = game:GetService('Players').LocalPlayer
local Character = Player.Character
if not Character or not Character.Parent then
Character = Player.CharacterAdded:Wait()
end
local Humanoid = Character:WaitForChild('Humanoid')
local Animator = Humanoid:WaitForChild('Animator')
local EquipAnimation = Tool.Animations.Equip
local EquipAnimationTrack = Humanoid:LoadAnimation(EquipAnimation)
EquipAnimationTrack.Priority = Enum.AnimationPriority.Action
EquipAnimationTrack.Looped = false
Tool.Equipped:Connect(function()
EquipAnimationTrack:Play()
end)
Tool.Unequipped:Connect(function()
EquipAnimationTrack:Stop()
end)
it works in the animation editor but not when i test it. Can anybody help?
I have two keyframes if that helps. I also have a Motor6D attached to the hand.

3 comments
My theory is that the animation was created without the tool. I'm not the best at animating so it's just a guess. I recommend looking up a tutorial
I did use the tool during animation. It may be because I motor6ded it to the hand.
Could possibly be the fact you're trying to change the looped setting - last time I checked you couldn't do that via script, remove that and see what happens. Not the greatest animator but have animated tools before, code checks out besides that one thing so have a go.