Weird behavior with arm moving

Hi there i was programming an arm grabbing/moving script something to look like a fake vr but somehow i’ve struggled on a very specific problem which i can not think of a solution to. The thing is…
when i hold “Q” my left arm should point to my mouse and when i hold “E” my right arm should point to my mouse but somehow i can only hold Q to move the left arm if the mouse is under the center of the screen otherwise i need to hold “E” to make it move??? and if i move it back under the center of the screen while still holding E right arm moves?? and i don’t really know what’s going on… this is very weird here’s a video:
robloxapp-20200625-0617215.wmv (833,7,KB)

and here’s the full script (server) and (local) below

--utlib
it,v3,u2,cf,rn,c3,bc,rd,pi,rn,ra,fl,ce,ts,ms,ca,create,swait = Instance.new,Vector3.new,UDim2.new,CFrame.new,Ray.new,Color3.new,BrickColor.new,math.rad,math.pi,Ray.new,math.random,math.floor,math.ceil,game:GetService("TweenService"),math.sqrt,CFrame.Angles,function(Object, ...) local Obj = Instance.new(Object) for i,v in next,(...) do Obj[i] = v end return Obj end,function(a) if a==0 or a==nil then game:GetService("RunService").Stepped:Wait(0)else for b=0,a do game:GetService("RunService").Stepped:Wait(0)end end end;function lerp(c,d,e,f,g)local h=0;for b=1,f*100 do if g==true then d=c.C0 end;c.C0=d:lerp(e,b/(f*100))wait(0.01)h=h+0.01 end end
--utlib
Debris = game:GetService("Debris")

local plyr = owner 
local char = plyr.Character
local rrs = char.Torso["Right Shoulder"]
local rls = char.Torso["Left Shoulder"] 
local la = char["Left Arm"]
local ra = char["Right Arm"]
local rot = char["HumanoidRootPart"]
local jp 
local jp2 
local cframe
local cframe2
--local m = plyr:GetMouse()
local asin = math.asin 
local sin = math.sin 
local ls=it("Weld",char.Torso)
local rs=it("Weld",char.Torso)
ls.Part0=rls.Part0
ls.Part1=rls.Part1
ls.C0=rls.C0
ls.C1=rls.C1 

rs.Part0=rrs.Part0
rs.Part1=rrs.Part1
rs.C0=rrs.C0
rs.C1=rrs.C1 
mouse={}
mouse.Hit=nil
mouse.Target=nil
mouse.Origin=nil
mev=it("RemoteEvent",char)
mev.Name="Mousev"
gra=it("RemoteEvent",char)
gra.Name="Grabe"
holdq=false 
holde=false 
rotlXd=false 
rotlYd=false 
rotlZd=false 
rotlXu=false 
rotlYu=false 
rotlZu=false 
rotrXd=false 
rotrYd=false 
rotrZd=false 
rotrXu=false 
rotrYu=false 
rotrZu=false 
local bp=it("BodyPosition")
local bp2=it("BodyPosition")
grabl=it("Weld",la)
grabr=it("Weld",ra)
grabl.Part0=la
grabr.Part0=ra
grabbingl=false
grabbingr=false
grabbed=false
rotate=false
grlc0=grabl.C0
grrc0=grabr.C0
welding=false 
curweld=nil
begwel=false 
inc=.1
mev.OnServerEvent:Connect(function(p,h,t,qs,es,zs,xs,cs,vs,fs,gs,hs,js,bs,ns,ks,ls)
mouse.Hit=h
mouse.Target=t
holdq=qs
holde=es

rotlXd=zs
rotlXu=xs
rotlYd=cs
rotlYu=vs
rotlZd=bs
rotlZu=ns
---------
rotrXd=fs
rotrXu=gs
rotrYd=hs
rotrYu=js
rotrZd=ks
rotrZu=ls
end)

function giveprop(p,x)
if x==3 then rotate=not rotate end 
if x==5 then grabl.C0=grlc0 end 
if x==6 then grabr.C0=grrc0 end 
if x==7 then 
if not welding and not begwel and mouse.Target~= nil then 
begwel=true 
welding=true
curweld=it("WeldConstraint",mouse.Target)
curweld.Part0=mouse.Target
end
if welding and not begwel and mouse.Target~= nil then 
begwel=true 
curweld.Part1=mouse.Target
welding=false
curweld=nil
end 
begwel=false
end 
if x==4 then if inc ==.1 then inc=1 else inc=.1 end end 
if x==1 and grabbingl==false and mouse.Target~= nil and not grabbed then 
grabbed=true
grabbingl=true
grabl.Part1=mouse.Target
end 
if x==1 and grabbingl==true and not grabbed then 
grabbed=true
grabl.Part1=nil
grabbingl=false
end 
if x==2 and grabbingr==false and mouse.Target~= nil and not grabbed then 
grabbed=true
grabbingr=true
grabr.Part1=mouse.Target
end 
if x==2 and grabbingr==true and not grabbed then 
grabbed=true
grabr.Part1=nil
grabbingr=false
end 
grabbed=false
end 

gra.OnServerEvent:Connect(giveprop)
wait(1)
print'begin'
repeat wait() until mouse.Hit~= nil 
game:GetService("RunService").Heartbeat:Connect(function()
local pcf =  mouse.Hit.p
if holde then 
	jp = rs.Part0.CFrame:toWorldSpace(cf(1, 0.5, 0))
	end
	if holdq then
	jp2 = ls.Part0.CFrame:toWorldSpace(cf(-1, 0.5, 0))
	end 
	if holde then
    cframe = cf()
	end
	if holdq then 
	cframe2 = cf()
	end
	if holde then
	cframe = cf(jp.p, pcf) * ca(0, 0, pi/2) * cf(0, 0, 0) * ca(rd(90),rd(0),rd(0))
	end
	if holdq then
	cframe2 = cf(jp2.p, pcf) * ca(0, 0, -pi/2) * cf(0, 0, 0) * ca(rd(90),rd(0),rd(0))
	end
	if holde then
	rs.C0 = rs.Part0.CFrame:toObjectSpace(cframe)	
	end 
	if holdq then
	ls.C0 = ls.Part0.CFrame:toObjectSpace(cframe2)
	end
	
	---
if rotate==false then 
if rotlXd then grabl.C0=grabl.C0+v3(-inc,0,0) end 
if rotlXu then grabl.C0=grabl.C0+v3(inc,0,0) end 
if rotlYd then grabl.C0=grabl.C0+v3(0,-inc,0) end 
if rotlYu then grabl.C0=grabl.C0+v3(0,inc,0) end 
if rotlZd then grabl.C0=grabl.C0+v3(0,0,-inc) end 
if rotlZu then grabl.C0=grabl.C0+v3(0,0,inc) end 
---------
if rotrXd then grabr.C0=grabr.C0+v3(-inc,0,0) end 
if rotrXu then grabr.C0=grabr.C0+v3(inc,0,0) end 
if rotrYd then grabr.C0=grabr.C0+v3(0,-inc,0) end 
if rotrYu then grabr.C0=grabr.C0+v3(0,inc,0) end 
if rotrZd then grabr.C0=grabr.C0+v3(0,0,-inc) end 
if rotrZu then grabr.C0=grabr.C0+v3(0,0,inc) end 
else 
if rotlXd then grabl.C0=grabl.C0*ca(rd(-inc),0,0) end 
if rotlXu then grabl.C0=grabl.C0*ca(rd(inc),0,0) end 
if rotlYd then grabl.C0=grabl.C0*ca(0,rd(-inc),0) end 
if rotlYu then grabl.C0=grabl.C0*ca(0,rd(inc),0) end 
if rotlZd then grabl.C0=grabl.C0*ca(0,0,rd(-inc)) end 
if rotlZu then grabl.C0=grabl.C0*ca(0,0,rd(inc)) end 
---------
if rotrXd then grabr.C0=grabr.C0*ca(rd(-inc),0,0) end 
if rotrXu then grabr.C0=grabr.C0*ca(rd(inc),0,0) end 
if rotrYd then grabr.C0=grabr.C0*ca(0,rd(-inc),0) end 
if rotrYu then grabr.C0=grabr.C0*ca(0,rd(inc),0) end 
if rotrZd then grabr.C0=grabr.C0*ca(0,0,rd(-inc)) end 
if rotrZu then grabr.C0=grabr.C0*ca(0,0,rd(inc)) end 
end 
end)

Local:

char=owner.Character
mev=char.Mousev
gre=char.Grabe
mouse=owner:GetMouse()
uis=game:GetService("UserInputService")
qs=false
es=false
zs=false
xs=false
cs=false
vs=false
fs=false
gs=false
hs=false
js=false
bs=false
ns=false
ks=false
ls=false
uis.InputBegan:Connect(function(k,g)
if k.KeyCode==Enum.KeyCode.Q and not g then qs=true end 
if k.KeyCode==Enum.KeyCode.E and not g then es=true end 
if k.KeyCode==Enum.KeyCode.Z and not g then zs=true end 
if k.KeyCode==Enum.KeyCode.X and not g then xs=true end 
if k.KeyCode==Enum.KeyCode.C and not g then cs=true end 
if k.KeyCode==Enum.KeyCode.V and not g then vs=true end 
if k.KeyCode==Enum.KeyCode.F and not g then fs=true end 
if k.KeyCode==Enum.KeyCode.G and not g then gs=true end 
if k.KeyCode==Enum.KeyCode.H and not g then hs=true end 
if k.KeyCode==Enum.KeyCode.J and not g then js=true end 
if k.KeyCode==Enum.KeyCode.B and not g then bs=true end 
if k.KeyCode==Enum.KeyCode.N and not g then ns=true end 
if k.KeyCode==Enum.KeyCode.K and not g then ks=true end 
if k.KeyCode==Enum.KeyCode.L and not g then ls=true end 
if k.KeyCode==Enum.KeyCode.R and not g then gre:FireServer(1) end 
if k.KeyCode==Enum.KeyCode.T and not g then gre:FireServer(2) end 
if k.KeyCode==Enum.KeyCode.Y and not g then gre:FireServer(3) end 
if k.KeyCode==Enum.KeyCode.U and not g then gre:FireServer(4) end 
if k.KeyCode==Enum.KeyCode.M and not g then gre:FireServer(5) end 
if k.KeyCode==Enum.KeyCode.Comma and not g then gre:FireServer(6) end 
if k.KeyCode==Enum.KeyCode.Period and not g then gre:FireServer(7) end 
end)
uis.InputEnded:Connect(function(k,g)
if k.KeyCode==Enum.KeyCode.Q and not g then qs=false end 
if k.KeyCode==Enum.KeyCode.E and not g then es=false end 
if k.KeyCode==Enum.KeyCode.Z and not g then zs=false end 
if k.KeyCode==Enum.KeyCode.X and not g then xs=false end 
if k.KeyCode==Enum.KeyCode.C and not g then cs=false end 
if k.KeyCode==Enum.KeyCode.V and not g then vs=false end 
if k.KeyCode==Enum.KeyCode.F and not g then fs=false end 
if k.KeyCode==Enum.KeyCode.G and not g then gs=false end 
if k.KeyCode==Enum.KeyCode.H and not g then hs=false end 
if k.KeyCode==Enum.KeyCode.J and not g then js=false end 
if k.KeyCode==Enum.KeyCode.B and not g then bs=false end 
if k.KeyCode==Enum.KeyCode.N and not g then ns=false end 
if k.KeyCode==Enum.KeyCode.K and not g then ks=false end 
if k.KeyCode==Enum.KeyCode.L and not g then ls=false end 
end)
game:GetService("RunService").RenderStepped:Connect(function()
mev:FireServer(mouse.Hit,mouse.Target,qs,es,zs,xs,cs,vs,fs,gs,hs,js,bs,ns,ks,ls)
end)

Anyone got an idea of what i did wrong?