Scope sensitive and upside down.

Can’t get you a screenshot but it works fine for me, not for my friends though.


function SWEP:Think()  
 
        if CLIENT and self.Weapon:GetNetworkedBool("Scope") then
                self.MouseSensitivity = self.Owner:GetFOV() / 70
        else
                self.MouseSensitivity = 1
        end
       
                if self.Owner:KeyDown( IN_FORWARD ) then
                                self.Primary.Spread     = 1
                elseif self.Owner:KeyDown( IN_BACK ) then
                                self.Primary.Spread     = 1
                elseif self.Owner:KeyDown( IN_MOVELEFT ) then
                                self.Primary.Spread     = 1
                elseif self.Owner:KeyDown( IN_MOVERIGHT ) then
                                self.Primary.Spread     = 1
                else
                        self.Primary.Spread     = 0
                end
       
        if not CLIENT and self.Weapon:GetNetworkedBool("Scope") then
 
                self.Owner:DrawViewModel(false)
        elseif not CLIENT then
 
                self.Owner:DrawViewModel(true)
        end
       
        self:Scope()
end
 
function SWEP:TranslateFOV(current_fov)
 
        if self.Weapon:GetNetworkedBool("Fov") == 0 then
 
        elseif self.Weapon:GetNetworkedBool("Fov") == 1 then
                current_fov = current_fov - 80
                end
        return current_fov
       
       
end
 
local LastViewAng = false
 
local function SimilarizeAngles (ang1, ang2)
 
        ang1.y = math.fmod (ang1.y, 360)
        ang2.y = math.fmod (ang2.y, 360)
 
        if math.abs (ang1.y - ang2.y) > 180 then
                if ang1.y - ang2.y < 0 then
                        ang1.y = ang1.y + 360
                else
                        ang1.y = ang1.y - 360
                end
        end
        end
        function SWEP:SetScope(b, player)
 
if CLIENT then return end
 
 
       
        if self.FovMode < 1 then
       
                self.FovMode = self.FovMode + 1
                self.Weapon:SetNetworkedInt("Fov",self.FovMode)
                self.Weapon:SetNetworkedBool("Scope",true)
        elseif self.FovMode == 1 then
                self.FovMode = 0
                self.Weapon:SetNetworkedInt("Fov",self.FovMode)
                self.Weapon:SetNetworkedBool("Scope",false)
        end
       
end
function SWEP:ResetScope()
 
if CLIENT then return end
 
        self.FovMode = 0
        self.Weapon:SetNetworkedInt("Fov",self.FovMode - 1)
        self.Weapon:SetNetworkedBool("Scope",false)
end
function SWEP:DrawHUD()
if self.Weapon:GetNetworkedBool("Scope") then
                local iScreenWidth = surface.ScreenWidth()
                local iScreenHeight = surface.ScreenHeight()
                                self.ScopeTable = {}
                self.ScopeTable.l = iScreenHeight*self.ScopeScale
                self.ScopeTable.x1 = 0.5*(iScreenWidth + self.ScopeTable.l)
                self.ScopeTable.y1 = 0.5*(iScreenHeight - self.ScopeTable.l)
                self.ScopeTable.x2 = self.ScopeTable.x1
                self.ScopeTable.y2 = 0.5*(iScreenHeight + self.ScopeTable.l)
                self.ScopeTable.x3 = 0.5*(iScreenWidth - self.ScopeTable.l)
                self.ScopeTable.y3 = self.ScopeTable.y2
                self.ScopeTable.x4 = self.ScopeTable.x3
                self.ScopeTable.y4 = self.ScopeTable.y1
                               
                self.ParaScopeTable = {}
                self.ParaScopeTable.x = 0.5*iScreenWidth - self.ScopeTable.l
                self.ParaScopeTable.y = 0.5*iScreenHeight - self.ScopeTable.l
                self.ParaScopeTable.w = 2*self.ScopeTable.l
                self.ParaScopeTable.h = 2*self.ScopeTable.l
               
                self.ScopeTable.l = (iScreenHeight + 1)*self.ScopeScale
                                self.QuadTable = {}
                self.QuadTable.x1 = 0
                self.QuadTable.y1 = 0
                self.QuadTable.w1 = iScreenWidth
                self.QuadTable.h1 = 0.5*iScreenHeight - self.ScopeTable.l
                self.QuadTable.x2 = 0
                self.QuadTable.y2 = 0.5*iScreenHeight + self.ScopeTable.l
                self.QuadTable.w2 = self.QuadTable.w1
                self.QuadTable.h2 = self.QuadTable.h1
                self.QuadTable.x3 = 0
                self.QuadTable.y3 = 0
                self.QuadTable.w3 = 0.5*iScreenWidth - self.ScopeTable.l
                self.QuadTable.h3 = iScreenHeight
                self.QuadTable.x4 = 0.5*iScreenWidth + self.ScopeTable.l
                self.QuadTable.y4 = 0
                self.QuadTable.w4 = self.QuadTable.w3
                self.QuadTable.h4 = self.QuadTable.h3
               
                self.LensTable = {}
                self.LensTable.x = self.QuadTable.w3
                self.LensTable.y = self.QuadTable.h1
                self.LensTable.w = 2*self.ScopeTable.l
                self.LensTable.h = 2*self.ScopeTable.l
               
                self.CrossHairTable = {}
                self.CrossHairTable.x11 = 0
                self.CrossHairTable.y11 = 0.5*iScreenHeight
                self.CrossHairTable.x12 = iScreenWidth / 2 - 5
                self.CrossHairTable.y12 = self.CrossHairTable.y11
               
                self.CrossHairTable.x21 = 0.5*iScreenWidth
                self.CrossHairTable.y21 = 0
                self.CrossHairTable.x22 = 0.5*iScreenWidth
                self.CrossHairTable.y22 = iScreenHeight/ 2 - 5
               
                self.CrossHairTable.x31 = 0.5*iScreenWidth
                self.CrossHairTable.y31 = iScreenHeight/2 + 5
                self.CrossHairTable.x32 = 0.5*iScreenWidth
                self.CrossHairTable.y32 = iScreenHeight
               
                self.CrossHairTable.x41 = iScreenWidth/2 + 5
                self.CrossHairTable.y41 = 0.5*iScreenHeight
                self.CrossHairTable.x42 = iScreenWidth
                self.CrossHairTable.y42 = 0.5*iScreenHeight
surface.SetDrawColor(0, 0, 0, 255)
                        surface.SetTexture(surface.GetTextureID("rtcw/reticle_256"))
                        surface.DrawTexturedRect(self.LensTable.x, self.LensTable.y, self.LensTable.w, self.LensTable.h)
 
 
                        surface.SetDrawColor(0, 0, 0, 255)
                        surface.DrawRect(self.QuadTable.x1 - 2.5, self.QuadTable.y1 - 2.5, self.QuadTable.w1 + 5, self.QuadTable.h1 + 5)
                        surface.DrawRect(self.QuadTable.x2 - 2.5, self.QuadTable.y2 - 2.5, self.QuadTable.w2 + 5, self.QuadTable.h2 + 5)
                        surface.DrawRect(self.QuadTable.x3 - 2.5, self.QuadTable.y3 - 2.5, self.QuadTable.w3 + 5, self.QuadTable.h3 + 5)
                        surface.DrawRect(self.QuadTable.x4 - 2.5, self.QuadTable.y4 - 2.5, self.QuadTable.w4 + 5, self.QuadTable.h4 + 5)
                        draw.RoundedBox(0,self.CrossHairTable.x11,self.CrossHairTable.y12,self.CrossHairTable.x12,2,Color(0,0,0,255))
                        draw.RoundedBox(0,self.CrossHairTable.x41,self.CrossHairTable.y42,self.CrossHairTable.x42,2,Color(0,0,0,255))
 
                        draw.RoundedBox(0,self.CrossHairTable.x31,self.CrossHairTable.y31,2,self.CrossHairTable.y32,Color(0,0,0,255))
local sin,cos,rad = math.sin,math.cos,math.rad;
end
end

this code is as useful as a condom when you masturbate.