Guest User

Untitled

a guest
Jul 22nd, 2013
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AddCSLuaFile()
  2. SWEP.Printname      = "Laser Pistol"
  3. SWEP.Author     = "( CalvinTheSpaceCat )"
  4. SWEP.Instructions       = "Left Click to shoot."
  5. SWEP.Spawnable      = true
  6. SWEP.Category       = "Calvin's SWEPS"
  7.  
  8. SWEP.DrawCrosshair = 1
  9.  
  10. SWEP.ReloadSound = "npc/assassin/ball_zap1.wav"
  11.  
  12. SWEP.Primary.Sound = "AlyxEMP.Discharge"
  13. SWEP.Primary.Damage = 15
  14. SWEP.Primary.TakeAmmo = 1
  15. SWEP.Primary.ClipSize = 20
  16. SWEP.Primary.Ammo = "Pistol"
  17. SWEP.Primary.DefaultClip = 20
  18. SWEP.Primary.Spread = 0.1
  19. SWEP.Primary.NumberofShots = 1
  20. SWEP.Primary.Automatic = true
  21. SWEP.Primary.Recoil = 5
  22. SWEP.Primary.Delay = 0.9
  23. SWEP.Primary.Force = 1000
  24. SWEP.Primary.Delay = 0.1
  25.  
  26. SWEP.Weight     = 4
  27. SWEP.AutoSwitchTo       = false
  28. SWEP.AutoSwitchFrom     = false
  29.  
  30. SWEP.Slot       = 2
  31. SWEP.SlotPos        = 2
  32. SWEP.DrawAmmo       = true
  33. SWEP.DrawCrosshair      =true
  34.  
  35. SWEP.HoldType = "pistol"
  36. SWEP.ViewModelFOV = 74.094488188976
  37. SWEP.ViewModelFlip = false
  38. SWEP.ViewModel = "models/weapons/c_pistol.mdl"
  39. SWEP.WorldModel = "models/weapons/w_pistol.mdl"
  40. SWEP.ShowViewModel = true
  41. SWEP.ShowWorldModel = true
  42. SWEP.ViewModelBoneMods = {}
  43. SWEP.UseHands = true
  44.  
  45. SWEP.base = "m9k_colt1911"
  46.  
  47. SWEP.IronSightsPos = Vector(-6.301, 0.55, 2.47)
  48. SWEP.IronSightsAng = Vector(3.03, -2.481, 1.325)
  49.  
  50. SWEP.VElements = {
  51.     ["232"] = { type = "Model", model = "models/props_combine/combine_window001.mdl", bone = "ValveBiped.square", rel = "", pos = Vector(0, 11.237, 3.734), angle = Angle(-97.89, 23.597, -69.604), size = Vector(0.068, 0.032, 0.057), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
  52.     ["New"] = { type = "Model", model = "models/Items/battery.mdl", bone = "ValveBiped.clip", rel = "", pos = Vector(0.307, 3.94, 3.569), angle = Angle(180, 93.002, -2.987), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
  53.     ["orange"] = { type = "Model", model = "models/weapons/w_pistol.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(5.946, 1.776, -2.774), angle = Angle(-180, -0.065, 3.831), size = Vector(0.5, 0.504, 0.5), color = Color(255, 120, 0, 255), surpresslightning = false, material = "models/debug/debugwhite", skin = 0, bodygroup = {} }
  54. }
  55. SWEP.WElements = {
  56.     ["232"] = { type = "Model", model = "models/props_combine/combine_window001.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(9.397, 1.957, -3.888), angle = Angle(9.689, 0, 0), size = Vector(0.068, 0.032, 0.048), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
  57.     ["New"] = { type = "Model", model = "models/Items/battery.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(8.373, 1.531, 3.388), angle = Angle(89.749, 0, 0), size = Vector(0.5, 0.5, 0.68), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
  58.     ["orange"] = { type = "Model", model = "models/weapons/w_pistol.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(5.513, 2.257, -3.835), angle = Angle(0.649, -180, -179.28), size = Vector(0.5, 0.504, 0.5), color = Color(255, 120, 0, 255), surpresslightning = false, material = "models/debug/debugwhite", skin = 0, bodygroup = {} }
  59. }
  60.  
  61.  
  62.  
  63. function SWEP:Initialize()
  64.     util.PrecacheSound(self.Primary.Sound)
  65.     util.PrecacheSound(self.Secondary.Sound)
  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, 1)
  78.                 //The above, sets how far the bullets spread from each other.
  79.         bullet.Tracer = 1
  80.         bullet.TracerName = "LaserTracer"
  81.         bullet.Force = self.Primary.Force
  82.         bullet.Damage = self.Primary.Damage
  83.         bullet.AmmoType = self.Primary.Ammo
  84.  
  85.     local rnda = self.Primary.Recoil * 0.1
  86.     local rndb = self.Primary.Recoil * math.random(0.1, 0.1)
  87.  
  88.     self:ShootEffects()
  89.  
  90.     self.Owner:FireBullets( bullet )
  91.     self:EmitSound(Sound(self.Primary.Sound))
  92.     self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
  93.     self:TakePrimaryAmmo(self.Primary.TakeAmmo)
  94.  
  95.     self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
  96. end
  97.  
  98. function SWEP:SecondaryAttack()
  99. end
RAW Paste Data