Two questions, need help

Hey!

My first question: Why can’t I animate the legs for this player when this code is running?
Here’s the code:

local char=script.Parent
local plr=game:service"Players"[char.Name]

repeat wait()until char and plr

local tors=char:waitForChild("Torso")
local root=char:waitForChild("HumanoidRootPart")
local hum=char:waitForChild("Humanoid")
local rh0,lh0=tors:waitForChild("Right Hip"),tors:waitForChild("Left Hip")
local rh,lh=Instance.new("Weld",tors),Instance.new("Weld",tors)
local rj=root.RootJoint
local org3=rj.C0
rh.Part0=tors
rh.Part1=char:WaitForChild("Right Leg")
rh.C0=rh0.C0
rh.C1=rh0.C1
lh.Part0=tors
lh.Part1=char:WaitForChild("Left Leg")
lh.C0=lh0.C0
lh.C1=lh0.C1
local org1,org2=rh.C0,lh.C0
local smoothness=0.45 -- 1 is divided by this number X10. Don't put the smoothness more than 10. I think 0.45 is noice and perfect
local sine=0

while true do
game:GetService("RunService").heartbeat:wait()
sine=tick()
local sidevec = math.clamp((root.Velocity * root.CFrame.rightVector).X + (root.Velocity * root.CFrame.rightVector).Z, -hum.WalkSpeed, hum.WalkSpeed)
local forwardvec = math.clamp((root.Velocity * root.CFrame.lookVector).X + (root.Velocity * root.CFrame.lookVector).Z, -hum.WalkSpeed, hum.WalkSpeed)

local sidevelocity = sidevec / hum.WalkSpeed
local forwardvelocity = forwardvec / hum.WalkSpeed
local moveVel= (tors.Velocity*Vector3.new(1,0,1)).magnitude
local moving=false
if moveVel>=1 then
	moving=true
end
if moveVel<1 then
	moving=false
end
rj.C0=rj.C0:lerp(org3*CFrame.Angles(forwardvelocity/10,-sidevelocity/10,0),1/(smoothness*10))
if moving then
	rh.C0=rh.C0:lerp(org1*CFrame.new(0,math.cos(sine*(hum.WalkSpeed/1.46))/(7-(hum.WalkSpeed/10)),0)*CFrame.Angles(math.rad((-sidevelocity*80)*(math.sin(sine*(hum.WalkSpeed/1.46))/(6))),0,math.rad((forwardvelocity*242)*(math.sin(sine*(hum.WalkSpeed/1.46))/(6)))),1/(smoothness*10))
	lh.C0=lh.C0:lerp(org2*CFrame.new(0,-math.cos(sine*(hum.WalkSpeed/1.46))/(7-(hum.WalkSpeed/10)),0)*CFrame.Angles(math.rad((-sidevelocity*80)*(math.sin(sine*(hum.WalkSpeed/1.46))/(6))),0,math.rad((forwardvelocity*242)*(math.sin(sine*(hum.WalkSpeed/1.46))/(6)))),1/(smoothness*10))
else
	rh.C0=rh.C0:lerp(org1*CFrame.Angles(-math.rad(1.5),-math.rad(3),0),1/(smoothness*10))
	lh.C0=lh.C0:lerp(org2*CFrame.Angles(-math.rad(1.5),math.rad(3),0),1/(smoothness*10))
end
end

(Goes in StarterCharacterScripts)

And for the second question, how would I animate a tool on where I can customly move the tool? (Like swing it without moving the arm)

Thanks for reading!