I need help with fixing the jitter from my script when i turn

I keep trying to make a similar method to get some easing style like tweening backing out bc I want to make something with it and…

here is how the it came up

robloxapp-20200824-1812259

i’ve tried doing some other ways to rotate and it seems to still jitter

local dampTime = tick()

local untiltime = .65
local cosMult = 11

local lerptime = tick()+untiltime
local lerp = 0


local deley = .01


local lastRotation = CFrame.Angles(workspace.CurrentCamera.CFrame:ToOrientation())--Vector3.new(0,0,0)

local from = CFrame.new()
local to = workspace.CurrentCamera.CFrame

local tickset = tick()

function set_twist(a,b)
	dampTime = tick()
	lerptime = tick()+untiltime
	tickset = tick()
	from = a
	to = b --CFrame.Angles(workspace.CurrentCamera.CFrame:ToOrientation())
end

function get_twist()
	
	local timetolerp = lerptime - (tick()-deley)---(dampTime+tick())
	
	--print(timetolerp)--print(timetolerp-(dampTime+tick()))
	
	local lerp = math.cos(((tick()-deley)-dampTime)*cosMult)*math.min(math.max(timetolerp,0),1)
	
	--print(lerp)
	
	local rot = ((to:Lerp(from,lerp)))
	
	return rot
end

local cliping = 2500--5729.5779513082 --3151.2678732195


workspace.PlayerConfigs.RotationCF:GetPropertyChangedSignal("Value"):Connect(function()
	
	local camcf = CFrame.fromEulerAnglesXYZ(workspace.CurrentCamera.CFrame:ToOrientation())
	
	
	local cfB = lastRotation:ToObjectSpace(camcf)
	
	
	local x,y,z = cfB:ToOrientation()
	--local x,y,z = workspace.CurrentCamera.CFrame:ToOrientation()
	--local camcf = CFrame.Angles(0,-y,0) * CFrame.Angles(0,0,-x) * CFrame.Angles(-z,0,0)
	local xaxis = script.EVERYTHING.LookAngleTwist.Value.X
	if math.abs(script.EVERYTHING.LookAngleTwist.Value.X) < math.abs(math.deg(x)) then
		xaxis = math.deg(x)
	end
	
	local yaxis = script.EVERYTHING.LookAngleTwist.Value.Y
	if math.abs(script.EVERYTHING.LookAngleTwist.Value.Y) < math.abs(math.deg(y)) then
		yaxis = math.deg(y)
	end
	
	local zaxis = script.EVERYTHING.LookAngleTwist.Value.Z
	if math.abs(script.EVERYTHING.LookAngleTwist.Value.Z) < math.abs(math.deg(z)) then
		zaxis = math.deg(z)
	end
	local CF = CFrame.fromEulerAnglesXYZ(yaxis,xaxis,zaxis)-- * cfB  --(CFrame.Angles(0,script.EVERYTHING.LookAngleTwist.Value.X,0) * CFrame.Angles(script.EVERYTHING.LookAngleTwist.Value.Y,0,0)) * cfB
	
	local C1,C2,C3 = CF:ToOrientation()
	
	local NewCF = CFrame.fromEulerAnglesXYZ( math.min(math.max(C1,-cliping),cliping) , math.min(math.max(C2,-cliping),cliping) , math.min(math.max(C3,-cliping),cliping) )
	
	local x1,y1,z1 = NewCF:ToOrientation()
	
	script.EVERYTHING.LookAngleTwist.Value = Vector3.new(x1,y1,0)*.75 --Vector3.new(NewCF:ToOrientation())
	
	set_twist(NewCF,CFrame.Angles(0,0,0))
end)

game:GetService("RunService").Stepped:Connect(function() --while wait(0.1) do
	
	if fpsen == true and workspace.CurrentCamera.CameraSubject == game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")  and hum.FPSDisabled.Value ~= true and em.Value ~= true then
		--local x,y,z = workspace.CurrentCamera.CFrame:ToOrientation()
		local rotation = CFrame.Angles(workspace.CurrentCamera.CFrame:ToOrientation())
		local lr,r = Vector3.new(lastRotation:ToOrientation()),Vector3.new(rotation:ToOrientation())
		
		--local fixed_LR = Vector3.new( math.floor(lr.X) , math.floor(lr.Y) , math.floor(lr.Z) )
		
		--local fixed_R = Vector3.new( math.floor(r.X) , math.floor(r.Y) , math.floor(r.Z) )
		
		--[[if lr ~= r then --fixed_LR ~= fixed_R then
			--warn("Movement Changed")
			set_twist(lastRotation)
		end]]--
			--local x1,y1,z1 = get_twist():ToOrientation()
			
			--print(math.deg(x1))
		if tickset+deley < tick() then
			local x1,y1,z1 = get_twist():ToOrientation()
			
			
			script.EVERYTHING.LookAngleTwist.Value = Vector3.new(x1,y1,0)*.75   --)
		end
		lastRotation = rotation
	end
end

This is what i’ve got in my script and I dont know why the arms jitter