Tool=script.Parent Handle=Tool:WaitForChild("\072\097\110\100\108\101")Players=game:GetService("\080\108\097\121\101\114\115")Animations={}ClientControl=Tool:WaitForChild("\067\108\105\101\110\116\067\111\110\116\114\111\108")ClientControl.OnClientInvoke=function(y,Z)if y=="\080\108\097\121\065\110\105\109\097\116\105\111\110"then for y,s in pairs(Animations)do if s.Animation==Z then s.AnimationTrack:Stop()table.remove(Animations,y)end end local y=Humanoid:LoadAnimation(Z.Animation)table.insert(Animations,{Animation=Z.Animation;AnimationTrack=y})y:Play(nil,nil,Z.Speed)end end function Equipped(y)Character=Tool.Parent Player=Players:GetPlayerFromCharacter(Character)Humanoid=Character:FindFirstChild("\072\117\109\097\110\111\105\100")if not Player or not Humanoid or Humanoid.Health==0 then return end end function Unequipped()for y,Z in pairs(Animations)do if Z and Z.AnimationTrack then Z.AnimationTrack:Stop()end end Animations={}end Tool.Equipped:connect(Equipped)Tool.Unequipped:connect(Unequipped)
--Rescripted by Luckymaxer

Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")

Animations = {}

ClientControl = Tool:WaitForChild("ClientControl")

ClientControl.OnClientInvoke = function(Mode, Value)
	if Mode == "PlayAnimation" then
		for i, v in pairs(Animations) do
			if v.Animation == Value then
				v.AnimationTrack:Stop()
				table.remove(Animations, i)
			end
		end
		local AnimationTrack = Humanoid:LoadAnimation(Value.Animation)
		table.insert(Animations, { Animation = Value.Animation, AnimationTrack = AnimationTrack })
		AnimationTrack:Play(nil, nil, Value.Speed)
	end
end

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not Player or not Humanoid or Humanoid.Health == 0 then
		return
	end
end

function Unequipped()
	for i, v in pairs(Animations) do
		if v and v.AnimationTrack then
			v.AnimationTrack:Stop()
		end
	end
	Animations = {}
end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
