How to stop the walking animation from playing on the characters arms when a tool is equipped? (Welds)

Recently I was making a system for riots basically players equip a tool it gets welded to their character. But how can I make it so that the basic walking animation does not apply to the arms when I have this specific tool equipped. I will put my code below. It is a server script under the tool. The script works but I want to know how to make the hands not move while the animation is playing and I have the tool equipped.

Server script:

Tool = script.Parent;
local arms = nil
local torso = nil
local welds = {}

function Equip(mouse)
	wait(0.01)
	local weld = Instance.new("Weld")
	weld.Part0 = script.Parent.Parent:WaitForChild("Left Arm")
	weld.Parent = script.Parent.Parent["Left Arm"]
	weld.Part1 = script.Parent.Handle2
	weld.C1 = CFrame.new(0.5, 0.1, 0) * CFrame.fromOrientation(0, math.rad(-180), math.rad(90))
	welds[1] = weld
	local ins = Instance.new("Weld")
	ins.Parent = script.Parent.Parent:FindFirstChild("Right Arm")
	ins.Part0 = script.Parent.Parent:FindFirstChild("Right Arm")
	ins.Part1 = script.Parent.Handle
	ins.C0 = CFrame.new(0, -1, 0) * CFrame.fromOrientation(math.rad(-90),0,0)
	ins.C1 = CFrame.new(0, -0.5, -1.162) * CFrame.fromOrientation(0,0,math.rad(-180))
	welds[2] = ins
	local torso = script.Parent.Parent:FindFirstChild("Torso")
	if torso then
		local leftArmMotor6D = torso:FindFirstChild("Left Shoulder")
		local rightArmMotor6D = torso:FindFirstChild("Right Shoulder")
		if leftArmMotor6D and rightArmMotor6D then
			leftArmMotor6D.C1 = CFrame.new(0.5, 0.5, 0) * CFrame.fromOrientation(0, math.rad(-90), math.rad(25))
			rightArmMotor6D.C1 = CFrame.new(-0.5, 0.5, 0) * CFrame.fromOrientation(math.rad(10), math.rad(90), math.rad(-30))
		end
	end
end

function Unequip(mouse)
	if arms ~= nil and torso ~= nil then
		local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
		if sh ~= nil then
			local yes = true
			if yes then
				yes = false
				sh[1].Part1 = arms[1]
				sh[2].Part1 = arms[2]
				welds[1]:Destroy()
				welds[2]:Destroy()
				welds[3]:Destroy()
				welds[4]:Destroy()
			end
		else
			print("sh")
		end
	else
		print("arms")
	end
end
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)

Please ignore the tool unequipped event, I have to update it.

Video:

External Media
2 Likes

Easiest way to do this would be to create a new animation with a higher priority than the default walking animation’s priority (movement) that has the arms animated to be locked to the side without any other body part being animated (make it looped). Then play this animation whenever the tool is equipped and stop it whenever it is unequipped

1 Like

Isn’t there a different way to do this? Because that animation also needs to be overlapped by an other animation. And having multiple animations playing makes it very unclear….

1 Like

you could probably just unrig and weld the arms when equipped and do the opposite for when u unequip them. IMO best method would be to do the one I mentioned before just set the animation to the highest priority

1 Like

But like the idle animation, does needs to be played. This is basically what I want to achieve: Untitled - Clipped with Medal.tv