Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- SWEP.PrintName = "AR3"
- SWEP.Author = "( CalvinTheSpaceCat )"
- SWEP.Instructions = "Left Click to shoot."
- SWEP.Spawnable = true
- SWEP.Category = "Calvin's SWEPS"
- SWEP.DrawCrosshair = 1
- SWEP.ReloadSound = "npc/strider/charging.wav"
- SWEP.Primary.Sound = "Weapon_AK47.Single"
- SWEP.Primary.Damage = 15
- SWEP.Primary.TakeAmmo = 1
- SWEP.Primary.ClipSize = 20
- SWEP.Primary.Ammo = "Pistol"
- SWEP.Primary.DefaultClip = 20
- SWEP.Primary.Spread = 0.1
- SWEP.Primary.NumberofShots = 1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Recoil = 2
- SWEP.Primary.Delay = 0.5
- SWEP.Primary.Force = 1000
- SWEP.Primary.Delay = 0.1
- SWEP.Weight = 4
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.Slot = 2
- SWEP.SlotPos = 2
- SWEP.DrawAmmo = true
- SWEP.DrawCrosshair =true
- SWEP.HoldType = "ar2"
- SWEP.ViewModelFOV = 70.314960629921
- SWEP.ViewModelFlip = true
- SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl"
- SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl"
- SWEP.ShowViewModel = true
- SWEP.ShowWorldModel = true
- SWEP.ViewModelBoneMods = {
- ["v_weapon.AK47_Clip"] = { scale = Vector(1.008, 1.008, 1.008), pos = Vector(-0.027, -0.028, -0.299), angle = Angle(0, 0, 0) }
- }
- SWEP.IronSightsPos = Vector(6.079, 0, 2.2)
- SWEP.IronSightsAng = Vector(2.2, 0, 0)
- SWEP.Base = "tdm_base"
- local IRONSIGHT_TIME = 0.25
- /*---------------------------------------------------------
- more iron sights yo
- ---------------------------------------------------------*/
- 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 < CurTime() - IRONSIGHT_TIME ) then
- return pos, ang
- end
- local Mul = 1.0
- if ( fIronTime > 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
- /*---------------------------------------------------------
- jawnpeice yo
- ---------------------------------------------------------*/
- function SWEP:SetIronsights( b )
- self.Weapon:SetNetworkedBool( "Ironsights", b )
- end
- SWEP.NextSecondaryAttack = 0
- /*---------------------------------------------------------
- Ironsights yo
- ---------------------------------------------------------*/
- function SWEP:SecondaryAttack()
- if ( !self.IronSightsPos ) then return end
- if ( self.NextSecondaryAttack > CurTime() ) then return end
- bIronsights = !self.Weapon:GetNetworkedBool( "Ironsights", false )
- local poop = 0.50
- self:SetIronsights( bIronsights )
- self.NextSecondaryAttack = CurTime() + 0.3
- end
- /*---------------------------------------------------------
- onRestore
- Loaded a saved game (or changelevel)
- ---------------------------------------------------------*/
- function SWEP:OnRestore()
- self.NextSecondaryAttack = 0
- self:SetIronsights( false )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement