Tool Idle animation broken

So I found a tool idle animation script. I tried it out, and it works, but when I equip the box with the idle animation, then I equip another tool, it does the idle animation that I don’t want it to do. How do I fix this?

Script:

local Box = nil
local animScript = nil
script.Parent.Equipped:Connect(function()
	Box = script.Parent
	animScript = Box.Parent:WaitForChild("Animate")
	animScript:WaitForChild("toolnone"):WaitForChild("ToolNoneAnim")
	animScript.toolnone.Box.AnimationId = "rbxassetid://5665639820"
end)

script.Parent.Equipped:Connect(function()
	Box = script.Parent
	animScript:WaitForChild("toolnone"):WaitForChild("ToolNoneAnim")
	animScript.toolnone.ToolNoneAnim.AnimationId = "rbxassetid://5665639820"
end)

Why do you have 2 Equipped events in one script?

I didnt create the script, someone else did.

Well you’re going to have to re-write it because the person who wrote it did a pretty poor job.

Can you send me a screenshot of what is inside both tools? My discord is daZau_nis#9283

local Tool = script.Parent
local IdleAnimation = "rbxassetid://5608461772"



local Anim = Instance.new("Animation", Tool)
Anim.Name = "Animation"
Anim.AnimationId = IdleAnimation
Tool.Equipped:Connect(function()
	local Character = Tool.Parent
	local Player = game.Players:GetPlayerFromCharacter(Character)
	if Player ~= nil then
		local Humanoid = Character:FindFirstChild("Humanoid")
		if Humanoid ~= nil then
			local LoadedAnim = Humanoid:LoadAnimation(Anim)
			LoadedAnim:Play()
		end
	end
end)


Tool.Unequipped:Connect(function()
	local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
	if Character ~= nil then
		local Humanoid = Character:FindFirstChild("Humanoid")
		if Humanoid ~= nil then
			local Anims = Humanoid:GetPlayingAnimationTracks()
			for i,v in pairs(Anims) do
				if v.Animation.AnimationId == IdleAnimation then
					v:Stop()
				end
			end
		end
	end
end)