Sniper Scope

how can i make i Sniper Scope in my sweps ??? need help quick

**[Player.SetFOV

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Player.SetFOV)**

it doesnt work :frowning:

It works fine

Your avatar is appropriate for this thread.

SetFOV is a serverside function so make sure you’re running it there. If you meant the scope overlay, look in materials/scope.

my Script, plz tell me the error

if ( SERVER ) then

AddCSLuaFile( "shared.lua" )

SWEP.HoldType			= "ar2"

function SWEP:SecondaryAttack()
-- We have already defined Zoomed as being false.
if (!Zoomed) then -- The player is not zoomed in

	Zoomed = true -- Now he is
	if SERVER then
		self.Owner:SetFOV( 45, 0.3 ) -- SetFOV is serverside only
	end
else -- If he is

	Zoomed = false -- We tell the SWEP that he is not
	if SERVER then
		self.Owner:SetFOV( 0, 0.3 ) -- Setting to 0 resets the FOV
	end
end

end

end

if ( CLIENT ) then

SWEP.DrawCrosshair = false

SWEP.PrintName = “Sniper”
SWEP.Author = “zoro7789”
SWEP.Slot = 4
SWEP.SlotPos = 1
SWEP.IconLetter = “w”

SWEP.ViewModelFlip = true

killicon.AddFont( “weapon_m4a1”, “CSKillIcons”, SWEP.IconLetter, Color( 255, 80, 0, 255 ) )

end

SWEP.Base = “weapon_cs_base”
SWEP.Category = “IS-SWEPS”

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.ViewModel = “models/weapons/v_snip_sg500.mdl”
SWEP.WorldModel = “models/weapons/w_snip_sg500.mdl”

SWEP.Weight = 3
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = false

SWEP.Primary.Sound = Sound( “weapons/sg500/sg500-1.wav” )
SWEP.Primary.Recoil = 2.0
SWEP.Primary.Damage = 95
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.00
SWEP.Primary.ClipSize = 10
SWEP.Primary.Delay = 0.09
SWEP.Primary.DefaultClip = 30
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = “smg1”

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “none”

SWEP.IronSightsPos = Vector(0, 0, 0)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.IronSightZoom = 2.3
SWEP.UseScope = true
SWEP.ScopeScale = 0.4
SWEP.ScopeZooms = {4, 8}
SWEP.DrawParabolicSights = true

A few redundant if SERVER checks, you’re ending an if when you’re using an else, and I don’t think the cs base supports scopes like that.

what base should i use ?