Advertisement
MiniPickels

Fix* Force awakens ZXBAton

Jan 24th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.00 KB | None | 0 0
  1.  
  2. //General Settings \\
  3. SWEP.AdminSpawnable = true // Is the swep spawnable for admin
  4. SWEP.ViewModelFOV = 64 // How much of the weapon do u see ?
  5. SWEP.ViewModel = "models/weapons/star wars the force awakens/spartanmark6/riot_control_stunbaton.mdl" // The viewModel, the model you se when you are holding it-.-
  6. SWEP.WorldModel = "models/weapons/star wars the force awakens/spartanmark6/riot_control_stunbaton.mdl" // The worlmodel, The model yu when it's down on the ground
  7. SWEP.AutoSwitchTo = false // when someone walks over the swep, chould i automatectly change to your swep ?
  8. SWEP.Slot = 1 // Deside wich slot you want your swep do be in 1 2 3 4 5 6
  9. SWEP.HoldType = "Pistol" // How the swep is hold Pistol smg greanade melee
  10. SWEP.PrintName = "ForceAwakens StunBaton" // your sweps name
  11. SWEP.Author = "Mini Pickels" // Your name
  12. SWEP.Spawnable = false // Can everybody spawn this swep ? - If you want only admin keep this false and adminsapwnable true.
  13. SWEP.AutoSwitchFrom = false // Does the weapon get changed by other sweps if you pick them up ?
  14. SWEP.FiresUnderwater = false // Does your swep fire under water ?
  15. SWEP.Weight = 5 // Chose the weight of the Swep
  16. SWEP.DrawCrosshair = true // Do you want it to have a crosshair ?
  17. SWEP.Category = "stunbaton" // Make your own catogory for the swep
  18. SWEP.SlotPos = 0 // Deside wich slot you want your swep do be in 1 2 3 4 5 6
  19. SWEP.DrawAmmo = true // Does the ammo show up when you are using it ? True / False
  20. SWEP.ReloadSound = "Weapon_Pistol.Reload" // Reload sound, you can use the default ones, or you can use your one; Example; "sound/myswepreload.waw"
  21. SWEP.Instructions = "Stun bad people" // How do pepole use your swep ?
  22. SWEP.Contact = "cocopickersgt@gmail.com" // How Pepole chould contact you if they find bugs, errors, etc
  23. SWEP.Purpose = "stunbaton" // What is the purpose with this swep ?
  24. SWEP.base = "weapon_base"
  25. //General settings\\
  26.  
  27. //PrimaryFire Settings\\
  28. SWEP.Primary.Sound = "Weapon_StunStick.Swing" // The sound that plays when you shoot :]
  29. SWEP.Primary.Damage = 0 // How much damage the swep is doing
  30. SWEP.Primary.TakeAmmo = 0 // How much ammo does it take for each shot ?
  31. SWEP.Primary.ClipSize = 0 // The clipsize
  32. SWEP.Primary.Ammo = "stunstick" // ammmo type pistol/ smg1
  33. SWEP.Primary.DefaultClip = 32 // How much ammo does the swep come with `?
  34. SWEP.Primary.Spread = 0.1 // Does the bullets spread all over, if you want it fire exactly where you are aiming leave it o.1
  35. SWEP.Primary.NumberofShots = 1 // How many bullets you are firing each shot.
  36. SWEP.Primary.Automatic = true // Is the swep automatic ?
  37. SWEP.Primary.Recoil = 1 // How much we should punch the view
  38. SWEP.Primary.Delay = 0.1 // How long time before you can fire again
  39. SWEP.Primary.Force = 10 // The force of the shot
  40. //PrimaryFire settings\\
  41.  
  42. //SecondaryProp Settings\\
  43. SWEP.Secondary.NumberofShots = 0 // How many props are you firing for each shot
  44. SWEP.Secondary.Force = 30 // The props force.
  45. SWEP.Secondary.Spread = 0 // How much does the props spread ?
  46. SWEP.Secondary.Sound = "Weapon_StunStick.Swing" // Sound for the swep..
  47. SWEP.Secondary.DefaultClip = 0 // ClipSize
  48. SWEP.Secondary.Automatic = false // Is it automatic ?
  49. SWEP.Secondary.AngVelocity = Angle(0,0,0) // Scary Stuff, Dont look at it !
  50. SWEP.Secondary.Ammo = "stunstick" // ammo, Leave this as pistol
  51. SWEP.Secondary.Model = "models/props_c17/FurnitureChair001a.mdl" // the model you want to fire.
  52. SWEP.Secondary.Recoil = 3 // How much we should punch the view
  53. SWEP.Secondary.Delay = 0 // How much time before you can fire again
  54. SWEP.Secondary.TakeAmmo = 0 // Ammo each shot take
  55. SWEP.Secondary.ClipSize = 0 // ClipSize
  56. SWEP.Secondary.Damage = 0 // Damage of the prop -.-
  57. //SecondaryProp Settings \\
  58.  
  59.  
  60.  
  61. -- Just leave this stuff untouched :)
  62.  
  63. //SWEP:Initialize()\\
  64. function SWEP:Initialize()
  65. util.PrecacheSound(self.Primary.Sound)
  66. util.PrecacheSound(self.Secondary.Sound)
  67. if ( SERVER ) then
  68. self:SetWeaponHoldType( self.HoldType )
  69. end
  70. end
  71. //SWEP:Initialize()\\
  72.  
  73. //SWEP:PrimaryFire()\\
  74. function SWEP:PrimaryAttack()
  75. if ( !self:CanPrimaryAttack() ) then return end
  76. local bullet = {}
  77. bullet.Num = self.Primary.NumberofShots
  78. bullet.Src = self.Owner:GetShootPos()
  79. bullet.Dir = self.Owner:GetAimVector()
  80. bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
  81. bullet.Tracer = 0
  82. bullet.Force = self.Primary.Force
  83. bullet.Damage = self.Primary.Damage
  84. bullet.AmmoType = self.Primary.Ammo
  85. local rnda = self.Primary.Recoil * -1
  86. local rndb = self.Primary.Recoil * math.random(-1, 1)
  87. self:ShootEffects()
  88. self.Owner:FireBullets( bullet )
  89. self.Weapon:EmitSound(Sound(self.Primary.Sound))
  90. self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
  91. self:TakePrimaryAmmo(self.Primary.TakeAmmo)
  92. self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
  93. self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
  94. end
  95. //SWEP:PrimaryFire()\\
  96.  
  97. //SWEP:SecondaryFire()\\
  98. function SWEP:SecondaryAttack()
  99. self:TakePrimaryAmmo(self.Secondary.TakeAmmo)
  100. self:Throw_Attack (self.Secondary.Model, self.Primary.Sound, self.Secondary.AngVelocity)
  101. self.Weapon:SetNextPrimaryFire( CurTime() + self.Secondary.Delay )
  102. self.Weapon:SetNextSecondaryFire( CurTime() + self.Secondary.Delay )
  103. end
  104. //SWEP:SecondaryFire()\\
  105.  
  106. //SWEP:Throw_Attack(Model, Sound, Angle)\\
  107. function SWEP:Throw_Attack (Model, Sound, Angle)
  108. local tr = self.Owner:GetEyeTrace()
  109. self.Weapon:EmitSound (Sound)
  110. self.BaseClass.ShootEffects (self)
  111. if (!SERVER) then return end
  112. local ent = ents.Create ("prop_physics")
  113. ent:SetModel (Model)
  114. ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 16))
  115. ent:SetAngles (self.Owner:EyeAngles())
  116. ent:Spawn()
  117. local phys = ent:GetPhysicsObject()
  118. local shot_length = tr.HitPos:Length()
  119. phys:ApplyForceCenter (self.Owner:GetAimVector():GetNormalized() * math.pow (shot_length, 7))
  120. phys:AddAngleVelocity(Angle)
  121. cleanup.Add (self.Owner, "props", ent)
  122. undo.Create ("Thrown model")
  123. undo.AddEntity (ent)
  124. undo.SetPlayer (self.Owner)
  125. undo.Finish()
  126. end
  127. //Throw_Attack(Model, Sound, Angle)\\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement