local function A(O,V)for O,p in pairs(O:GetChildren())do if p:IsA("\066\097\115\101\080\097\114\116")and not p:IsDescendantOf(Gun)then p.LocalTransparencyModifier=V end A(p,V)end end local function O(A)local O=A.lookVector local V=math.atan2(O.x,-O.z)local p=math.atan(O.y/-math.sqrt(O.x^2+O.z^2))return V,p end local function V()return(camOffsets.guiScope.Rot+camOffsets.Reload.Rot)+camRecoilSpring.p end function renderCamera()local A=V()Cam.CameraType=Enum.CameraType.Scriptable Cam.CoordinateFrame=((CF(Head.Position)*CFANG(0,camAng.X+A.X,0))*CFANG(camAng.Y+A.Y,0,0))*CF(0,0,.5)Cam:SetRoll(crawlCamRot+A.Z)end
--------------------[ CAMERA RENDERING FUNCTIONS ]-----------------------------------

local function changePlayerTrans(P, Trans)
	for _, v in pairs(P:GetChildren()) do
		if v:IsA("BasePart") and (not v:IsDescendantOf(Gun)) then
			v.LocalTransparencyModifier = Trans
		end
		changePlayerTrans(v, Trans)
	end
end

local function getYawPitch(Cf)
	local LV = Cf.lookVector
	local Yaw = math.atan2(LV.x, -LV.z)
	local Pitch = math.atan(LV.y / -math.sqrt((LV.x ^ 2) + (LV.z ^ 2)))
	return Yaw, Pitch
end

local function getTotalCamOffset()
	return camOffsets.guiScope.Rot + camOffsets.Reload.Rot + camRecoilSpring.p
end

function renderCamera()
	local finalCamOffset = getTotalCamOffset()
	Cam.CameraType = Enum.CameraType.Scriptable
	Cam.CoordinateFrame = CF(Head.Position)
		* CFANG(0, camAng.X + finalCamOffset.X, 0)
		* CFANG(camAng.Y + finalCamOffset.Y, 0, 0)
		* CF(0, 0, 0.5)
	Cam:SetRoll(crawlCamRot + finalCamOffset.Z)
end
