Help with animation

  1. What do you want to achieve? I’m trying to make a tool, when you activate the tool it is running animation with the tool.

  2. What is the issue? When I activate the tool the hand where the animation activates is not working.

  3. What solutions have you tried so far? I tried to look on youtube and make a different edition of codes but didn’t help.

script.Parent.Equipped:Connect(function(Mouse)
	Mouse.Button1Down:Connect(function()
	local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
		animation:Play()
	end)
end)
1 Like

So I found a solution for it.

local script

local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=6307341520"
local track
tool.Equipped:Connect(function()
    track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
    track.Priority = Enum.AnimationPriority.Action
	track:Play()
	wait(1)
	track:Stop()
	tool:Destroy()
end)

requirements:
Screenshot_65