Custom Viewmodel movement(When walking)

Hello there, Facepunchers! I’ve been working on a SWEP, with an ironsight code a friend of mine let me use:


local IRONSIGHT_TIME = 0.50

VmPos, VmAng = Vector(0,0,0), Angle(0,0,0)
WantedPos, WantedAng = Vector(0,0,0), Angle(0,0,0)
SetPos, SetAng = Vector(0,0,0), Angle(0,0,0)
VmSmooth = 0

function SWEP:GetViewModelPosition( pos, ang )
                       
	bIron = self:GetNWBool( "Ironsights" )
	
	if bIron then
		self.SwayScale = 0.25
		self.BobScale = 0.25
	else
		self.SwayScale = 1
		self.BobScale = 1
	end
	
	if bIron then
		if self.IronSightsPos and self.IronSightsAng then
			SetPos = self.IronSightsPos
			SetAng = self.IronSightsAng
		end
		VmSmooth = IRONSIGHT_TIME * 30
	elseif !bIron then
		SetPos = Vector(0,0,0)
		SetAng = Angle(0,0,0)
		--VmSmooth = 5
		VmSmooth = IRONSIGHT_TIME * 30
	end

	WantedPos = LerpVector(FrameTime() * VmSmooth, WantedPos, SetPos)
	WantedAng = LerpAngle(FrameTime() * VmSmooth, WantedAng, SetAng)

	VmPos.x = WantedPos.x
	VmPos.y = WantedPos.y
	VmPos.z = WantedPos.z
   
	VmAng.p = WantedAng.p
	VmAng.y = WantedAng.y
	VmAng.r = WantedAng.r
   
	Right = ang:Right()
	Up = ang:Up()
	Forward = ang:Forward()
	
	ang = ang * 1
	ang:RotateAroundAxis( Right, VmAng.p )
	ang:RotateAroundAxis( Up, VmAng.y )
	ang:RotateAroundAxis( Forward, VmAng.r )      
   
	pos = pos + VmPos.x * Right
	pos = pos + VmPos.y * Forward
	pos = pos + VmPos.z * Up
   
	return pos, ang
       
end

So, I want to add on to this. Basically, what I want to do is add viewmodel movement when walking(basically replacing what SWEP.BobScale defines, AKA the basic HL2 viewmodel bob). But, I don’t really know how I’d do this…