Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //General Settings\\
- SWEP.Base = "tfa_gun_base" -- modified
- SWEP.AdminOnly = false -- added
- SWEP.ViewModelFOV = 70 -- modified
- SWEP.UseHands = true
- SWEP.ViewModel = "models/weapons/tfa_v_navymp5.mdl" -- modified
- SWEP.WorldModel = "models/weapons/tfa_w_hk_mp5.mdl" -- modified
- SWEP.AutoSwitchTo = true
- SWEP.Slot = 2 -- modified
- SWEP.ViewModelFlip = true
- SWEP.Primary.Cone = 0.04
- SWEP.HoldType = "ar2" -- modified
- SWEP.PrintName = "Airsoft HK MP5" -- modified
- SWEP.Author = "pLASTER & [FR] rlevet" -- modified
- SWEP.Spawnable = true // Can everybody spawn this swep ? - If you want only admin keep this false and adminsapwnable true.
- SWEP.AutoSwitchFrom = true // Does the weapon get changed by other sweps if you pick them up ?
- SWEP.FiresUnderwater = false // Does your swep fire under water ?
- SWEP.Weight = 30 -- modified
- SWEP.DrawCrosshair = true -- modified
- SWEP.Category = "TFA Airsoft" -- modified
- SWEP.SlotPos = 46 -- modified
- SWEP.DrawAmmo = true // Does the ammo show up when you are using it ? True / False
- --SWEP.ReloadSound = "Weapon_Pistol.Reload" // Reload sound, you can use the default ones, or you can use your one; Example; "sound/myswepreload.waw"
- SWEP.Instructions = "" -- nothing
- SWEP.Contact = "Steam Workshop Page" -- modified
- SWEP.Purpose = "Airsoft replica of the HK MP5" -- modified
- SWEP.Primary.Sound = "weapons/airsoft/mp5bb_fix.wav" // The sound that plays when you shoot :]
- SWEP.Primary.Damage = GetConVar("airsoft_tfa_damage_mp5"):GetFloat() -- replaced by convars - needs a reload to update
- SWEP.Primary.TakeAmmo = 1 // How much ammo does it take for each shot ?
- SWEP.Primary.ClipSize = 30 // The clipsize
- SWEP.Primary.Ammo = "airsoft_tfa" -- modified (new ammo type)
- SWEP.Primary.DefaultClip = 60 -- modified
- SWEP.Primary.Spread = 0.02 -- modified // Does the bullets spread all over, if you want it fire exactly where you are aiming leave it o.1 -- .023 for the original TFA weapon
- SWEP.Primary.NumberofShots = 1 // How many bullets you are firing each shot.
- SWEP.Primary.Automatic = true // Is the swep automatic ?
- SWEP.Primary.Recoil = 0.04 -- modified // How much we should punch the view
- SWEP.Primary.Delay = 0.11 // How long time before you can fire again
- SWEP.Primary.Force = 1 // The force of the shot
- SWEP.HeadshotMultiplier = 0.04
- -- TFA
- SWEP.Primary.IronAccuracy = .013 -- Ironsight accuracy, should be the same for shotguns
- -- Enter iron sight info and bone mod info below
- SWEP.IronSightsPos = Vector(2.549, -0.927, 1.09)
- SWEP.IronSightsAng = Vector(0.125, -0.071, 0)
- SWEP.SightsPos = Vector(2.549, -0.927, 1.09)
- SWEP.SightsAng = Vector(0.125, -0.071, 0)
- SWEP.RunSightsPos = Vector (-3.0328, 0, 1.888)
- SWEP.RunSightsAng = Vector (-24.2146, -36.522, 10)
- if GetConVar("sv_tfa_default_clip") == nil then
- print("sv_tfa_default_clip is missing! You might've hit the lua limit. Contact the SWEP author(s).")
- else
- if GetConVar("sv_tfa_default_clip"):GetInt() != -1 then
- SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("sv_tfa_default_clip"):GetInt()
- end
- end
- if GetConVar("sv_tfa_unique_slots") != nil then
- if not (GetConVar("sv_tfa_unique_slots"):GetBool()) then
- SWEP.SlotPos = 2
- end
- end
- -- TFA END
- //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 = 1
- bullet.TracerName = "Tracer"
- 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.Owner:FireBullets(bullet)
- self.Weapon:EmitSound(Sound(self.Primary.Sound))
- self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
- self:TakePrimaryAmmo(self.Primary.TakeAmmo)
- self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
- self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
- end
- function SWEP:DoImpactEffect( tr, nDamageType )
- return true;
- end
- //SWEP:SecondaryAttack\\
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.Pistol = false
- SWEP.Rifle = true
- SWEP.Shotgun = false
- SWEP.Sniper = false
- -- Disabled cuz TFA uses others pos
- --SWEP.IronSightsPos = Vector( -5.3008, -8.0566, 1.763 )
- --SWEP.IronSightsAng = Vector( 1.7323, 0.1444, 0 )
- --SWEP.RunArmOffset = Vector( -1.7118, -2.2656, -2.6876 )
- --SWEP.RunArmAngle = Vector( -8.0413, 27.648, -9.2012 )
- /*---------------------------------------------------------
- Name: SWEP:Precache()
- Desc: Use this function to precache stuff.
- ---------------------------------------------------------*/
- function SWEP:Precache()
- util.PrecacheSound("weapons/airsoft/mp5bb_fix.wav")
- end
Add Comment
Please, Sign In to add comment