Advertisement
Guest User

Sos

a guest
Feb 10th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. /*---------------------------------
  2. Created with buu342s Swep Creator
  3. ---------------------------------*/
  4.  
  5. SWEP.PrintName = "TestWeapon2016"
  6.  
  7. SWEP.Author = "Old Bill"
  8. SWEP.Contact = "oldbillandmedic@gmail.com"
  9. SWEP.Purpose = "To shoot noobs"
  10. SWEP.Instructions = "Left click to shoot smg, right click to shoot shotgun."
  11.  
  12. SWEP.Category = "Best Guns in GMod"
  13.  
  14. SWEP.Spawnable= true
  15. SWEP.AdminSpawnable= true
  16. SWEP.AdminOnly = false
  17.  
  18. SWEP.ViewModelFOV = 70
  19. SWEP.ViewModel = "models/weapons/c_pistoltest_gun.mdl"
  20. SWEP.WorldModel = "models/weapons/w_pistoltest.mdl"
  21. SWEP.ViewModelFlip = false
  22.  
  23. SWEP.AutoSwitchTo = false
  24. SWEP.AutoSwitchFrom = false
  25.  
  26. SWEP.Slot = 2
  27. SWEP.SlotPos = 1
  28.  
  29. SWEP.UseHands = false
  30.  
  31. SWEP.HoldType = "Pistol"
  32.  
  33. SWEP.FiresUnderwater = true
  34.  
  35. SWEP.DrawCrosshair = true
  36.  
  37. SWEP.DrawAmmo = true
  38.  
  39. SWEP.ReloadSound = "weapons/pistol/pistol_reload1.wav"
  40.  
  41. SWEP.Base = "weapon_base"
  42.  
  43. SWEP.Primary.Sound = Sound("weapons/pistol/pistol_fire2.wav")
  44. SWEP.Primary.Damage = 12
  45. SWEP.Primary.TakeAmmo = 1
  46. SWEP.Primary.ClipSize = 12
  47. SWEP.Primary.Ammo = "Pistol"
  48. SWEP.Primary.DefaultClip = 12
  49. SWEP.Primary.Spread = 0.1
  50. SWEP.Primary.NumberofShots = 1
  51. SWEP.Primary.Automatic = false
  52. SWEP.Primary.Recoil = 0.5
  53. SWEP.Primary.Delay = 0.02
  54. SWEP.Primary.Force = 5
  55.  
  56. SWEP.Secondary.ClipSize = 0
  57. SWEP.Secondary.DefaultClip = 0
  58. SWEP.Secondary.Automatic = false
  59. SWEP.Secondary.Ammo = "none"
  60.  
  61. SWEP.CSMuzzleFlashes = false
  62.  
  63. function SWEP:Initialize()
  64. util.PrecacheSound(self.Primary.Sound)
  65. util.PrecacheSound(self.ReloadSound)
  66. self:SetWeaponHoldType( self.HoldType )
  67. end
  68.  
  69. function SWEP:PrimaryAttack()
  70.  
  71. if ( !self:CanPrimaryAttack() ) then return end
  72.  
  73. local bullet = {}
  74. bullet.Num = self.Primary.NumberofShots
  75. bullet.Src = self.Owner:GetShootPos()
  76. bullet.Dir = self.Owner:GetAimVector()
  77. bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
  78. bullet.Tracer = 0
  79. bullet.Force = self.Primary.Force
  80. bullet.Damage = self.Primary.Damage
  81. bullet.AmmoType = self.Primary.Ammo
  82.  
  83. local rnda = self.Primary.Recoil * -1
  84. local rndb = self.Primary.Recoil * math.random(-1, 1)
  85.  
  86. self:ShootEffects()
  87.  
  88. self.Owner:FireBullets( bullet )
  89. self:EmitSound(Sound(self.Primary.Sound))
  90. self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
  91. self:TakePrimaryAmmo(self.Primary.TakeAmmo)
  92.  
  93. self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
  94. self:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
  95. end
  96.  
  97. function SWEP:SecondaryAttack()
  98. end
  99.  
  100. function SWEP:Reload()
  101. self:EmitSound(Sound(self.ReloadSound))
  102. self.Weapon:DefaultReload( ACT_VM_RELOAD );
  103. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement