When I equip the tool, the Motor6D angle changes but when I unequip the tool, the angle doesn't change and I get this output:

Stack Begin Script 'Players.HyperPublic.Backpack.Pistol.Arm', Line 6 Stack End

The LocalScript:

tool = script.Parent
handle = tool:WaitForChild("Handle")


tool.Equipped:Connect(function()
	
	script.Parent.Parent.Torso["Right Shoulder"].CurrentAngle = 1.571
	
end)

--This part changes to the angle 1.571


tool.Unequipped:Connect(function()
	
	script.Parent.Parent.Torso["Right Shoulder"].CurrentAngle = 0
	
end)

--The arm doesn't go back to 0