Swep Ironsights

I have been having some trouble adding ironsights to the custom deagle swep that I have added to my TTT server. I have googled the issue and tried some things without luck. I give this as my thanks in advance: http://www.youtube.com/watch?v=2eVit5Dxmuc Thank you facepunch gods <3

[LUA]if ( SERVER ) then

AddCSLuaFile( "shared.lua" )

SWEP.HoldType			= "pistol"

end

if ( CLIENT ) then

SWEP.PrintName			= "Stacey"			
SWEP.Author			= "TripleThreat"

SWEP.Slot			= 1
SWEP.iconletter			= "f"

local Color_Icon = Color( 255, 80, 0, 128 )

end

SWEP.Base = “weapon_tttbase”

SWEP.Spawnable = true
SWEP.AdminOnly = true

SWEP.ViewModel = “models/weapons/v_pist_deagon.mdl”
SWEP.WorldModel = “models/weapons/w_pist_deagon.mdl”
SWEP.ViewModelFlip = true
SWEP.IronSightsPos = Vector(-6.361, -3.701, 2.15)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.WeaponID = AMMO_DEAGLE
SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = false

SWEP.HoldType = “Pistol” // How the swep is hold Pistol smg greanade melee

SWEP.FiresUnderwater = true // Does your swep fire under water ?

SWEP.Weight = 5 // Chose the weight of the Swep

SWEP.DrawCrosshair = true // Do you want it to have a crosshair ?

SWEP.Category = “TripleThreat’s Weapons” // Make your own catogory for the swep

SWEP.DrawAmmo = true // Does the ammo show up when you are using it ? True / False

SWEP.ReloadSound = “sound/weapons/alyxgun/alyx_gun_reload.wav” // Reload sound, you can use the default ones, or you can use your one; Example; “sound/myswepreload.waw”

SWEP.base = “weapon_tttbase”

SWEP.CSMuzzleFlashes = true

//General settings\

//PrimaryFire Settings\
SWEP.Kind = WEAPON_PISTOL
SWEP.Primary.Sound = “weapons/automag/deagle-1.wav”
SWEP.Primary.Damage = 37 // How much damage the swep is doing
SWEP.Primary.TakeAmmo = 1 // How much ammo does it take for each shot ?
SWEP.Primary.ClipSize = 8 // The clipsize
SWEP.Primary.Ammo = “AlyxGun” // ammmo type pistol/ smg1
SWEP.AmmoEnt = “item_ammo_revolver_ttt”
SWEP.Primary.DefaultClip = 8 // How much ammo does the swep come with `?
SWEP.Primary.Spread = 0.1 // Does the bullets spread all over, if you want it fire exactly where you are aiming leave it 0.1
SWEP.Primary.NumberofShots = 1 // How many bullets you are firing each shot.
SWEP.Primary.ClipMax = 36
SWEP.Primary.Automatic = false // Is the swep automatic ?
SWEP.Primary.Recoil = 3 // How much we should punch the view
SWEP.Primary.Delay = 0.6 // How long time before you can fire again
SWEP.HeadshotMultiplier = 4
SWEP.Primary.Cone = 0.02
//SecondaryFire settings\

//SWEP:Initialize\
function SWEP:Initialize()
util.PrecacheSound(self.Primary.Sound)
self:SetWeaponHoldType( self.HoldType )
end
//SWEP:Initialize\

//SWEP:PrimaryFire\
function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end

local bullet = {} 
	bullet.Num = self.Primary.NumberofShots 
	bullet.Src = self.Owner:GetShootPos() 
	bullet.Dir = self.Owner:GetAimVector() 
	bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0) 
	bullet.Tracer = 0 
	bullet.Force = self.Primary.Force 
	bullet.Damage = self.Primary.Damage 
	bullet.AmmoType = self.Primary.Ammo 

local rnda = self.Primary.Recoil * -1 
local rndb = self.Primary.Recoil * math.random(-1, 1) 

self:ShootEffects() 

self.Owner:FireBullets( bullet ) 
self:EmitSound(Sound(self.Primary.Sound)) 
// self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) ) \\
self:TakePrimaryAmmo(self.Primary.TakeAmmo) 

self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )

end
//SWEP:PrimaryFire\

//SWEP:SecondaryFire\
function SWEP:SecondaryAttack()

end

–Respectfully taken from Garry’s weapon_cs_base
local IRONSIGHT_TIME = 0.25

/---------------------------------------------------------
Name: GetViewModelPosition
Desc: Allows you to re-position the view model
---------------------------------------------------------
/
function SWEP:GetViewModelPosition( pos, ang )

if ( !self.IronSightsPos ) then return pos, ang end

local bIron = self.Weapon:GetNetworkedBool( "Ironsights" )

if ( bIron != self.bLastIron ) then

	self.bLastIron = bIron 
	self.fIronTime = CurTime()
	
	if ( bIron ) then 
		self.SwayScale 	= 0.3
		self.BobScale 	= 0.1
	else 
		self.SwayScale 	= 1.0
		self.BobScale 	= 1.0
	end

end

local fIronTime = self.fIronTime or 0

if ( !bIron && fIronTime &lt; CurTime() - IRONSIGHT_TIME ) then 
	return pos, ang 
end

local Mul = 1.0

if ( fIronTime &gt; CurTime() - IRONSIGHT_TIME ) then

	Mul = math.Clamp( (CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1 )
	
	if (!bIron) then Mul = 1 - Mul end

end

local Offset	= self.IronSightsPos

if ( self.IronSightsAng ) then

	ang = ang * 1
	ang:RotateAroundAxis( ang:Right(), 		self.IronSightsAng.x * Mul )
	ang:RotateAroundAxis( ang:Up(), 		self.IronSightsAng.y * Mul )
	ang:RotateAroundAxis( ang:Forward(), 	self.IronSightsAng.z * Mul )


end

local Right 	= ang:Right()
local Up 		= ang:Up()
local Forward 	= ang:Forward()



pos = pos + Offset.x * Right * Mul
pos = pos + Offset.y * Forward * Mul
pos = pos + Offset.z * Up * Mul

return pos, ang

end[/LUA]