Advertisement
Guest User

Code

a guest
Jan 22nd, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.52 KB | None | 0 0
  1. if ( SERVER ) then
  2.  
  3. AddCSLuaFile( "shared.lua" )
  4.  
  5. end
  6.  
  7. if ( CLIENT ) then
  8.  
  9. SWEP.PrintName = "Z6 Rotary Blaster HighEx"
  10. SWEP.Author = "TFA"
  11. SWEP.ViewModelFOV = 50
  12. SWEP.Slot = 4
  13. SWEP.SlotPos = 72
  14. end
  15.  
  16. SWEP.HoldType = "crossbow"
  17. SWEP.Base = "tfa_swsft_base_servius"
  18.  
  19. SWEP.Category = "TFA Star Wars"
  20.  
  21. SWEP.Spawnable = true
  22. SWEP.AdminSpawnable = true
  23.  
  24. SWEP.HoldType = "crossbow"
  25. SWEP.ViewModelFOV = 56.08040201005
  26. SWEP.ViewModelFlip = false
  27. SWEP.ViewModel = "models/weapons/tfa_sw_z6_v2.mdl"
  28. SWEP.WorldModel = "models/weapons/w_z6_rotary_blaster.mdl"--"models/weapons/w_crossbow.mdl"
  29. SWEP.ShowViewModel = true
  30. SWEP.ShowWorldModel = true
  31. SWEP.UseHands = true
  32. SWEP.ViewModelBoneMods = {
  33. ["ValveBiped.Bip01_R_Finger01"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(0, 0, 15.312) },
  34. ["barrel"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) }
  35. }
  36.  
  37. SWEP.VMPos = Vector(2,-2,-1)
  38.  
  39. sound.Add( {
  40. name = "TFA_SW_Z6.Fire",
  41. channel = CHAN_USER_BASE+11,
  42. volume = 1.0,
  43. level = 100,
  44. pitch = { 95, 110 },
  45. sound = "weapons/z6_rotary/repeat-1.wav"
  46. } )
  47.  
  48. sound.Add( {
  49. name = "TFA_SW_Z6.StartSpin",
  50. channel = CHAN_USER_BASE+12,
  51. volume = 1.0,
  52. level = 70,
  53. pitch = { 100, 100 },
  54. sound = "weapons/z6_rotary/z6_startspin.wav"
  55. } )
  56.  
  57. sound.Add( {
  58. name = "TFA_SW_Z6.StopSpin",
  59. channel = CHAN_USER_BASE+12,
  60. volume = 1.0,
  61. level = 70,
  62. pitch = { 100, 100 },
  63. sound = "weapons/z6_rotary/z6_stopspin.wav"
  64. } )
  65.  
  66. sound.Add( {
  67. name = "TFA_SW_Z6.Spin",
  68. channel = CHAN_USER_BASE+12,
  69. volume = 1.0,
  70. level = 70,
  71. pitch = { 100, 100 },
  72. sound = "weapons/z6_rotary/z6_spin.wav"
  73. } )
  74.  
  75. sound.Add( {
  76. name = "TFA_SW_Z6.Reload",
  77. channel = CHAN_USER_BASE+12,
  78. volume = 1.0,
  79. level = 120,
  80. pitch = { 95, 110 },
  81. sound = "weapons/shared/standard_reload.ogg"
  82. } )
  83.  
  84. SWEP.Primary.Sound = Sound ("TFA_SW_Z6.Fire");
  85. SWEP.Primary.ReloadSound = Sound ("weapons/shared/standard_reload.ogg");
  86.  
  87. SWEP.Weight = 5
  88. SWEP.AutoSwitchTo = false
  89. SWEP.AutoSwitchFrom = false
  90. SWEP.Primary.Recoil = 1
  91. SWEP.Primary.Damage = 300
  92. SWEP.DamageType = bit.bor(DMG_SHOCK,DMG_BLAST)
  93. SWEP.Primary.NumShots = 3
  94. SWEP.Primary.Spread = 0.0001
  95. SWEP.Primary.ClipSize = 300
  96. SWEP.Primary.RPM = 40
  97. SWEP.Primary.RPM_Base = 40
  98. SWEP.Primary.RPM_Max = 60
  99. SWEP.Primary.RPM_TransitionTime = 1.5
  100. SWEP.Primary.DefaultClip = 30
  101. SWEP.Primary.KickUp = 3
  102. SWEP.Primary.Automatic = true
  103. SWEP.Primary.Ammo = "ar2"
  104. SWEP.TracerName = "effect_sw_laser_red"
  105.  
  106. SWEP.Secondary.Automatic = false
  107. SWEP.Secondary.Ammo = "none"
  108.  
  109. SWEP.data = {}
  110. SWEP.data.ironsights = 0
  111.  
  112. SWEP.BlowbackVector = Vector(0,-3,0.025)
  113. SWEP.Blowback_Only_Iron = false
  114.  
  115. SWEP.DoProceduralReload = true
  116. SWEP.ProceduralReloadTime = 3
  117.  
  118. SWEP.WElements = {
  119. --["element_name"] = { type = "Model", model = "models/weapons/w_z6_rotary_blaster.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(20.194, 1, -8.351), angle = Angle(-21.119, 0, 180), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
  120. }
  121.  
  122. SWEP.Offset = {
  123. Pos = {
  124. Up = -8.351,
  125. Right = 1,
  126. Forward = 20.194,
  127. },
  128. Ang = {
  129. Up = 0,
  130. Right = -21.19,
  131. Forward = 178
  132. },
  133. Scale = 1
  134. }
  135.  
  136. SWEP.NextSpinSound = 0
  137.  
  138. SWEP.BarrelRotation = 0
  139. SWEP.BarrelVelocity = 0
  140. SWEP.BarrelVelocityMax = 360*4.25
  141. SWEP.BarrelAcceleration = SWEP.BarrelVelocityMax / SWEP.Primary.RPM_TransitionTime
  142. SWEP.BarrelFriction = SWEP.BarrelVelocityMax / SWEP.Primary.RPM_TransitionTime * 2
  143.  
  144. local oldsh,sh,shfac,rpmfac,baracc
  145. local rpmdif = SWEP.Primary.RPM_Max - SWEP.Primary.RPM_Base
  146.  
  147. DEFINE_BASECLASS("tfa_swsft_base_servius")
  148.  
  149. function SWEP:Deploy()
  150. self.BarrelRotation = 0
  151. self.BarrelVelocity = 0
  152. self.NextSpinSound = CurTime()
  153. return BaseClass.Deploy(self)
  154. end
  155.  
  156. function SWEP:Think2()
  157. BaseClass.Think2(self)
  158. sh = (self.Owner:KeyDown(IN_ATTACK) and ( TFA.Enum.ReadyStatus[self:GetStatus()] or self:GetStatus() == TFA.Enum.STATUS_SHOOTING ) and not self:IsSafety() and self:Clip1() > 0)
  159.  
  160. if oldsh == nil then
  161. oldsh = sh
  162. end
  163.  
  164. if SERVER or (CLIENT and not game.SinglePlayer()) then
  165. if not oldsh and sh then
  166. self:EmitSound("TFA_SW_Z6.StartSpin")
  167. self.NextSpinSound = CurTime() + SoundDuration("weapons/z6_rotary/z6_startspin.wav") - 0.5
  168. elseif oldsh and not sh then
  169. self:EmitSound("TFA_SW_Z6.StopSpin")
  170. self.NextSpinSound = CurTime() + SoundDuration("weapons/z6_rotary/z6_stopspin.wav")
  171. elseif sh then
  172. if CurTime() > self.NextSpinSound then
  173. self:EmitSound("TFA_SW_Z6.Spin")
  174. self.NextSpinSound = CurTime() + SoundDuration("weapons/z6_rotary/z6_spin.wav")
  175. end
  176. elseif not sh then
  177. self:StopSound("TFA_SW_Z6.Spin")
  178. end
  179. end
  180.  
  181. oldsh = sh
  182. shfac = sh and 1 or 0
  183. rpmfac = sh and self.Primary.RPM_Max or self.Primary.RPM_Base
  184. self.Primary.RPM = math.Approach(self.Primary.RPM, rpmfac, rpmdif / self.Primary.RPM_TransitionTime * TFA.FrameTime())
  185. self.BarrelVelocity = math.Clamp(self.BarrelVelocity + (sh and self.BarrelAcceleration or -self.BarrelFriction) * TFA.FrameTime(), 0, self.BarrelVelocityMax)
  186. self.BarrelRotation = math.NormalizeAngle(self.BarrelRotation + self.BarrelVelocity * TFA.FrameTime())
  187. self.ViewModelBoneMods["barrel"].angle.p = self.BarrelRotation
  188. end
  189.  
  190. SWEP.MoveSpeed = 0.65
  191.  
  192.  
  193. _____________________________________________________________________
  194.  
  195. SWEP.Gun = ("tfa_sw_cisshot") --Make sure this is unique. Specically, your folder name.
  196. if (GetConVar(SWEP.Gun.."_allowed")) != nil then
  197. if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "tfa_blacklisted" SWEP.PrintName = SWEP.Gun return end
  198. end
  199. SWEP.Base = "tfa_gun_base"
  200. SWEP.Category = "TFA Star Wars" --The category. Please, just choose something generic or something I've already done if you plan on only doing like one swep..
  201. SWEP.Manufacturer = nil --Gun Manufactrer (e.g. Hoeckler and Koch )
  202. SWEP.Author = "TFA" --Author Tooltip
  203. SWEP.Contact = "http://www.steamcommunity.com/id/theforgottenarchitect" --Contact Info Tooltip
  204. SWEP.Purpose = "" --Purpose Tooltip
  205. SWEP.Instructions = "" --Instructions Tooltip
  206. SWEP.Spawnable = true --Can you, as a normal user, spawn this?
  207. SWEP.AdminSpawnable = true --Can an adminstrator spawn this? Does not tie into your admin mod necessarily, unless its coded to allow for GMod's default ranks somewhere in its code. Evolve and ULX should work, but try to use weapon restriction rather than these.
  208. SWEP.DrawCrosshair = true -- Draw the crosshair?
  209. SWEP.DrawCrosshairIS = false --Draw the crosshair in ironsights?
  210. SWEP.PrintName = "Bowcaster" -- Weapon name (Shown on HUD)
  211. SWEP.Slot = 2 -- Slot in the weapon selection menu. Subtract 1, as this starts at 0.
  212. SWEP.SlotPos = 73 -- Position in the slot
  213. SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter if enabled in the GUI.
  214. SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box
  215. SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce?
  216. SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up
  217. SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon
  218. SWEP.Weight = 30 -- This controls how "good" the weapon is for autopickup.
  219.  
  220. --[[WEAPON HANDLING]]--
  221.  
  222. --Firing related
  223. SWEP.Primary.Sound = Sound ("weapons/bowcaster/BOWCASTER_fire.ogg") -- This is the sound of the weapon, when you shoot.
  224. SWEP.Primary.SilencedSound = nil -- This is the sound of the weapon, when silenced.
  225. SWEP.Primary.PenetrationMultiplier = 1 --Change the amount of something this gun can penetrate through
  226. SWEP.Primary.Damage = 160 -- Damage, in standard damage points.
  227. SWEP.Primary.HullSize = 0 --Big bullets, increase this value. They increase the hull size of the hitscan bullet.
  228. SWEP.DamageType = bit.bor(DMG_SHOCK,DMG_BLAST)--See DMG enum. This might be DMG_SHOCK, DMG_BURN, DMG_BULLET, etc.
  229. SWEP.Primary.NumShots = 3 --The number of shots the weapon fires. SWEP.Shotgun is NOT required for this to be >1.
  230. SWEP.Primary.Automatic = true -- Automatic/Semi Auto
  231. SWEP.Primary.RPM = 30 -- This is in Rounds Per Minute / RPM
  232. SWEP.Primary.RPM_Semi = nil -- RPM for semi-automatic or burst fire. This is in Rounds Per Minute / RPM
  233. SWEP.FiresUnderwater = false
  234.  
  235. SWEP.CanBeSilenced = false --Can we silence? Requires animations.
  236. SWEP.Silenced = false --Silenced by default?
  237.  
  238. -- Selective Fire Stuff
  239.  
  240. SWEP.SelectiveFire = true --Allow selecting your firemode?
  241. SWEP.DisableBurstFire = false --Only auto/single?
  242. SWEP.OnlyBurstFire = false --No auto, only burst/single?
  243. SWEP.DefaultFireMode = "auto" --Default to auto or whatev
  244. SWEP.FireModeName = nil --Change to a text value to override it
  245.  
  246. --Ammo Related
  247.  
  248. SWEP.Primary.ClipSize = 10 -- This is the size of a clip
  249. SWEP.Primary.DefaultClip = 250 -- This is the number of bullets the gun gives you, counting a clip as defined directly above.
  250. SWEP.Primary.Ammo = "ar2" -- What kind of ammo. Options, besides custom, include pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, and AirboatGun.
  251. --Pistol, buckshot, and slam like to ricochet. Use AirboatGun for a light metal peircing shotgun pellets
  252.  
  253. SWEP.DisableChambering = true --Disable round-in-the-chamber
  254.  
  255. --Recoil Related
  256. SWEP.Primary.KickUp = 1 -- This is the maximum upwards recoil (rise)
  257. SWEP.Primary.KickDown = 0.2 -- This is the maximum downwards recoil (skeet)
  258. SWEP.Primary.KickHorizontal = 0.3 -- This is the maximum sideways recoil (no real term)
  259. SWEP.Primary.StaticRecoilFactor = 0.05 --Amount of recoil to directly apply to EyeAngles. Enter what fraction or percentage (in decimal form) you want. This is also affected by a convar that defaults to 0.5.
  260.  
  261. --Firing Cone Related
  262.  
  263. SWEP.Primary.Spread = 0.0125 --This is hip-fire acuracy. Less is more (1 is horribly awful, .0001 is close to perfect)
  264. SWEP.Primary.IronAccuracy = 0.0125/2 -- Ironsight accuracy, should be the same for shotguns
  265.  
  266. --Unless you can do this manually, autodetect it. If you decide to manually do these, uncomment this block and remove this line.
  267. --SWEP.Primary.SpreadMultiplierMax = 2.5 --How far the spread can expand when you shoot.
  268. --SWEP.Primary.SpreadIncrement = 1/3.5 --What percentage of the modifier is added on, per shot.
  269. --SWEP.Primary.SpreadRecovery = 3 --How much the spread recovers, per second.
  270.  
  271. --Range Related
  272. SWEP.Primary.Range = -1 -- The distance the bullet can travel in source units. Set to -1 to autodetect based on damage/rpm.
  273. SWEP.Primary.RangeFalloff = 0.5 -- The percentage of the range the bullet damage starts to fall off at. Set to 0.8, for example, to start falling off after 80% of the range.
  274.  
  275.  
  276. --Penetration Related
  277.  
  278. SWEP.MaxPenetrationCounter=4 --The maximum number of ricochets. To prevent stack overflows.
  279.  
  280. --Misc
  281. SWEP.IronRecoilMultiplier=0.5 --Multiply recoil by this factor when we're in ironsights. This is proportional, not inversely.
  282. SWEP.CrouchRecoilMultiplier=0.65 --Multiply recoil by this factor when we're crouching. This is proportional, not inversely.
  283. SWEP.JumpRecoilMultiplier=1.3 --Multiply recoil by this factor when we're crouching. This is proportional, not inversely.
  284. SWEP.WallRecoilMultiplier=1.1 --Multiply recoil by this factor when we're changing state e.g. not completely ironsighted. This is proportional, not inversely.
  285. SWEP.ChangeStateRecoilMultiplier=1.3 --Multiply recoil by this factor when we're crouching. This is proportional, not inversely.
  286. SWEP.CrouchAccuracyMultiplier=0.5--Less is more. Accuracy * 0.5 = Twice as accurate, Accuracy * 0.1 = Ten times as accurate
  287. SWEP.ChangeStateAccuracyMultiplier=1.5 --Less is more. A change of state is when we're in the progress of doing something, like crouching or ironsighting. Accuracy * 2 = Half as accurate. Accuracy * 5 = 1/5 as accurate
  288. SWEP.JumpAccuracyMultiplier=2--Less is more. Accuracy * 2 = Half as accurate. Accuracy * 5 = 1/5 as accurate
  289. SWEP.WalkAccuracyMultiplier=1.35--Less is more. Accuracy * 2 = Half as accurate. Accuracy * 5 = 1/5 as accurate
  290. SWEP.IronSightTime = 0.3 --The time to enter ironsights/exit it.
  291. SWEP.NearWallTime = 0.25 --The time to pull up your weapon or put it back down
  292. SWEP.ToCrouchTime = 0.05 --The time it takes to enter crouching state
  293. SWEP.WeaponLength = 40 --Almost 3 feet Feet. This should be how far the weapon sticks out from the player. This is used for calculating the nearwall trace.
  294. SWEP.MoveSpeed = 1 --Multiply the player's movespeed by this.
  295. SWEP.IronSightsMoveSpeed = 0.8 --Multiply the player's movespeed by this when sighting.
  296. SWEP.SprintFOVOffset = 3.75 --Add this onto the FOV when we're sprinting.
  297.  
  298. --[[PROJECTILES]]--
  299.  
  300. SWEP.ProjectileEntity = nil --Entity to shoot
  301. SWEP.ProjectileVelocity = 0 --Entity to shoot's velocity
  302. SWEP.ProjectileModel = nil --Entity to shoot's model
  303.  
  304. --[[VIEWMODEL]]--
  305.  
  306. SWEP.ViewModel = "models/weapons/cstrike/c_snip_awp.mdl" --Viewmodel path
  307. SWEP.ViewModelFOV = 56 -- This controls how big the viewmodel looks. Less is more.
  308. SWEP.ViewModelFlip = false -- Set this to true for CSS models, or false for everything else (with a righthanded viewmodel.)
  309. SWEP.MaterialTable = nil --Make sure the viewmodel and the worldmodel have the same material ids. Next, fill this in with your desired submaterials.
  310. SWEP.UseHands = true --Use gmod c_arms system.
  311. SWEP.VMPos = Vector(0, 0, 0)
  312. SWEP.VMAng = Vector(0, 0, 0)
  313. SWEP.VMBodyGroups = nil --{
  314. --[0] = 1,
  315. --[1] = 4,
  316. --[2] = etc.
  317. --}
  318.  
  319. --[[WORLDMODEL]]--
  320.  
  321. SWEP.WorldModel = "models/weapons/w_irifle.mdl" -- Weapon world model path
  322.  
  323. SWEP.WMBodyGroups = nil--{
  324. --[0] = 1,
  325. --[1] = 4,
  326. --[2] = etc.
  327. --}
  328.  
  329. SWEP.HoldType = "shotgun" -- This is how others view you carrying the weapon. Options include:
  330. -- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
  331. -- You're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles
  332.  
  333. SWEP.Offset = { --Procedural world model animation, defaulted for CS:S purposes.
  334. Pos = {
  335. Up = 0.8,
  336. Right = 0.5,
  337. Forward = 13
  338. },
  339. Ang = {
  340. Up = -1,
  341. Right = -13,
  342. Forward = 178
  343. },
  344. Scale = 0.9
  345. }
  346.  
  347. SWEP.ThirdPersonReloadDisable = false --Disable third person reload? True disables.
  348.  
  349. --[[SCOPES]]--
  350.  
  351. SWEP.IronSightsSensitivity = 0.1 --Useful for a RT scope. Change this to 0.25 for 25% sensitivity. This is if normal FOV compenstaion isn't your thing for whatever reason, so don't change it for normal scopes.
  352. SWEP.BoltAction = false --Unscope/sight after you shoot?
  353. SWEP.Scoped = true --Draw a scope overlay?
  354.  
  355. SWEP.ScopeOverlayThreshold = 0.875 --Percentage you have to be sighted in to see the scope.
  356. SWEP.BoltTimerOffset = 0.25 --How long you stay sighted in after shooting, with a bolt action.
  357.  
  358. SWEP.ScopeScale = 1.0 --Scale of the scope overlay
  359. SWEP.ReticleScale = 0.5 --Scale of the reticle overlay
  360.  
  361. --GDCW Overlay Options. Only choose one.
  362.  
  363. SWEP.Secondary.UseACOG = false --Overlay option
  364. SWEP.Secondary.UseMilDot = false --Overlay option
  365. SWEP.Secondary.UseSVD = false --Overlay option
  366. SWEP.Secondary.UseParabolic = false --Overlay option
  367. SWEP.Secondary.UseElcan = false --Overlay option
  368. SWEP.Secondary.UseGreenDuplex = true --Overlay option
  369.  
  370. if surface then
  371. SWEP.Secondary.ScopeTable = nil --[[
  372. {
  373. scopetex = surface.GetTextureID("scope/gdcw_closedsight"),
  374. reticletex = surface.GetTextureID("scope/gdcw_acogchevron"),
  375. dottex = surface.GetTextureID("scope/gdcw_acogcross")
  376. }
  377. ]]--
  378. end
  379.  
  380. --[[SHOTGUN CODE]]--
  381.  
  382. SWEP.Shotgun = false --Enable shotgun style reloading.
  383.  
  384. SWEP.ShellTime = .35 -- For shotguns, how long it takes to insert a shell.
  385.  
  386. --[[SPRINTING]]--
  387.  
  388. SWEP.RunSightsPos = Vector(0.0, -2, 0)
  389. SWEP.RunSightsAng = Vector(-8.443, 10.553, -16.181)
  390.  
  391. --[[IRONSIGHTS]]--
  392.  
  393. SWEP.data = {}
  394. SWEP.data.ironsights = 1 --Enable Ironsights
  395. SWEP.Secondary.IronFOV = 10 -- How much you 'zoom' in. Less is more! Don't have this be <= 0. A good value for ironsights is like 70.
  396.  
  397. SWEP.IronSightsPos = Vector(-7.321, -8.495, 2.759)
  398. SWEP.IronSightsAng = Vector(0, 0, 0)
  399.  
  400. --[[INSPECTION]]--
  401.  
  402. --SWEP.InspectPos = Vector(0,0,0) --Replace with a vector, in style of ironsights position, to be used for inspection
  403. --SWEP.InspectAng = Vector(0,0,0) --Replace with a vector, in style of ironsights angle, to be used for inspection
  404.  
  405. --[[VIEWMODEL ANIMATION HANDLING]]--
  406.  
  407. SWEP.ShootWhileDraw=false --Can you shoot while draw anim plays?
  408. SWEP.AllowReloadWhileDraw=false --Can you reload while draw anim plays?
  409. SWEP.SightWhileDraw=false --Can we sight in while the weapon is drawing / the draw anim plays?
  410. SWEP.AllowReloadWhileHolster=true --Can we interrupt holstering for reloading?
  411. SWEP.ShootWhileHolster=true --Cam we interrupt holstering for shooting?
  412. SWEP.SightWhileHolster=false --Cancel out "iron"sights when we holster?
  413. SWEP.UnSightOnReload=true --Cancel out ironsights for reloading.
  414. SWEP.AllowReloadWhileSprinting=false --Can you reload when close to a wall and facing it?
  415. SWEP.AllowReloadWhileNearWall=false --Can you reload when close to a wall and facing it?
  416. SWEP.SprintBobMult=1.5 -- More is more bobbing, proportionally. This is multiplication, not addition. You want to make this > 1 probably for sprinting.
  417. SWEP.IronBobMult=0 -- More is more bobbing, proportionally. This is multiplication, not addition. You want to make this < 1 for sighting, 0 to outright disable.
  418. SWEP.IronBobMultWalk=0.2 -- More is more bobbing, proportionally. This is multiplication, not addition. You want to make this < 1 for sighting, 0 to outright disable.
  419. SWEP.AllowViewAttachment = true --Allow the view to sway based on weapon attachment while reloading or drawing, IF THE CLIENT HAS IT ENABLED IN THEIR CONVARS!!!!11111oneONEELEVEN
  420.  
  421.  
  422. --[[VIEWMODEL BLOWBACK]]--
  423.  
  424. SWEP.BlowbackEnabled = true --Enable Blowback?
  425. SWEP.BlowbackVector = Vector(0,-5,0.2) --Vector to move bone <or root> relative to bone <or view> orientation.
  426. SWEP.BlowbackCurrentRoot = 0 --Amount of blowback currently, for root
  427. SWEP.BlowbackCurrent = 0 --Amount of blowback currently, for bones
  428. SWEP.BlowbackBoneMods = nil --Viewmodel bone mods via SWEP Creation Kit
  429. SWEP.Blowback_Only_Iron = false --Only do blowback on ironsights
  430. SWEP.Blowback_PistolMode = false --Do we recover from blowback when empty?
  431. SWEP.Blowback_Shell_Enabled = true
  432. SWEP.Blowback_Shell_Effect = ""
  433.  
  434. --[[HOLDTYPES]]--
  435.  
  436. SWEP.IronSightHoldTypeOverride="" --This variable overrides the ironsights holdtype, choosing it instead of something from the above tables. Change it to "" to disable.
  437. SWEP.SprintHoldTypeOverride="" --This variable overrides the sprint holdtype, choosing it instead of something from the above tables. Change it to "" to disable.
  438.  
  439. --[[ANIMATION]]--
  440.  
  441. SWEP.ForceDryFireOff = true --Disables dryfire. Set to false to enable them.
  442. SWEP.DisableIdleAnimations = true --Disables idle animations. Set to false to enable them.
  443. SWEP.ForceEmptyFireOff = true --Disables empty fire animations. Set to false to enable them.
  444.  
  445. --If you really want, you can remove things from SWEP.actlist and manually enable animations and set their lengths.
  446.  
  447. SWEP.SequenceEnabled = {} --Self explanitory. This can forcefully enable or disable a certain ACT_VM
  448. SWEP.SequenceLength = {} --This controls the length of a certain ACT_VM
  449. SWEP.SequenceLengthOverride={} --Override this if you want to change the length of a sequence but not the next idle
  450.  
  451. --[[EFFECTS]]--
  452.  
  453. --Muzzle Smoke
  454.  
  455. SWEP.SmokeParticles = { pistol = "", --These are particle effects INSIDE a pcf file, not PCF files, that are played when you shoot.
  456. smg = "",
  457. grenade = "",
  458. ar2 = "",
  459. shotgun = "",
  460. rpg = "",
  461. physgun = "",
  462. crossbow = "",
  463. melee = "",
  464. slam = "",
  465. normal = "",
  466. melee2 = "",
  467. knife = "",
  468. duel = "",
  469. camera = "",
  470. magic = "",
  471. revolver = "",
  472. silenced = ""
  473. }
  474.  
  475. --Muzzle Flash
  476.  
  477. SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
  478. --SWEP.MuzzleAttachmentRaw = 1 --This will override whatever string you gave. This is the raw attachment number. This is overridden or created when a gun makes a muzzle event.
  479. SWEP.ShellAttachment = "2" -- Should be "2" for CSS models or "shell" for hl2 models
  480.  
  481. SWEP.DoMuzzleFlash = false --Do a muzzle flash?
  482. SWEP.CustomMuzzleFlash = false --Disable muzzle anim events and use our custom flashes?
  483. SWEP.AutoDetectMuzzleAttachment = false --For multi-barrel weapons, detect the proper attachment?
  484. SWEP.MuzzleFlashEffect = "" --Change to a string of your muzzle flash effect. Copy/paste one of the existing from the base.
  485.  
  486. --Shell eject override
  487.  
  488. SWEP.LuaShellEject = true
  489. SWEP.LuaShellEjectDelay = 0.0
  490. SWEP.LuaShellEffect = "" --Defaults to blowback
  491.  
  492. --Tracer Stuff
  493.  
  494. SWEP.Tracer = 0 --Bullet tracer. TracerName overrides this.
  495. SWEP.TracerName = "effect_sw_laser_green" --Change to a string of your tracer name. Can be custom.
  496. --There is a nice example at https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/entities/effects/tooltracer.lua
  497. SWEP.TracerCount = 1 --0 disables, otherwise, 1 in X chance
  498.  
  499.  
  500. SWEP.TracerLua = false --Use lua effect, TFA Muzzle syntax. Currently obsolete.
  501. SWEP.TracerDelay = 0.01 --Delay for lua tracer effect
  502.  
  503. --Impact Effects
  504.  
  505. SWEP.ImpactEffect = "effect_sw_impact" --Impact Effect
  506.  
  507. --[[EVENT TABLE]]--
  508.  
  509. SWEP.EventTable = {} --Event Table, used for custom events when an action is played. This can even do stuff like playing a pump animation after shooting.
  510.  
  511. --example:
  512. --SWEP.EventTable = {
  513. -- [ACT_VM_RELOAD] = {
  514. -- { ['time'] = 0.1, ['type'] = "lua", ['value'] = examplefunction, ['client'] = true, ['server'] = false },
  515. -- { ['time'] = 0.2, ['type'] = "sound", ['value'] = Sound("ExampleGun.Sound1", ['client'] = true, ['server'] = false ) }
  516. -- }
  517. --}
  518.  
  519. --[[AKIMBO]]--
  520.  
  521. SWEP.Akimbo = false --Akimbo gun? Alternates between primary and secondary attacks.
  522. SWEP.AnimCycle = 0 -- Start on the right
  523.  
  524. --[[TTT]]--
  525.  
  526. local gm = engine.ActiveGamemode()
  527. if string.find(gm,"ttt") or string.find(gm,"terrorist") then
  528. SWEP.Kind = WEAPON_HEAVY
  529. SWEP.AutoSpawnable = false
  530. SWEP.AllowDrop = true
  531. SWEP.AmmoEnt = "item_ammo_smg1_ttt"
  532. end
  533.  
  534.  
  535. --[[MISC INFO FOR MODELERS]]--
  536.  
  537. --[[
  538.  
  539. Used Animations (for modelers):
  540.  
  541. ACT_VM_DRAW - Draw
  542. ACT_VM_DRAW_EMPTY - Draw empty
  543. ACT_VM_DRAW_SILENCED - Draw silenced, overrides empty
  544.  
  545. ACT_VM_IDLE - Idle
  546. ACT_VM_IDLE_SILENCED - Idle empty, overwritten by silenced
  547. ACT_VM_IDLE_SILENCED - Idle silenced
  548.  
  549. ACT_VM_PRIMARYATTACK - Shoot
  550. ACT_VM_PRIMARYATTACK_EMPTY - Shoot last chambered bullet
  551. ACT_VM_PRIMARYATTACK_SILENCED - Shoot silenced, overrides empty
  552. ACT_VM_PRIMARYATTACK_1 - Shoot ironsights, overriden by everything besides normal shooting
  553. ACT_VM_DRYFIRE - Dryfire
  554.  
  555. ACT_VM_RELOAD - Reload / Tactical Reload / Insert Shotgun Shell
  556. ACT_SHOTGUN_RELOAD_START - Start shotgun reload, unless ACT_VM_RELOAD_EMPTY is there.
  557. ACT_SHOTGUN_RELOAD_FINISH - End shotgun reload.
  558. ACT_VM_RELOAD_EMPTY - Empty mag reload, chambers the new round. Works for shotguns too, where applicable.
  559. ACT_VM_RELOAD_SILENCED - Silenced reload, overwrites all
  560.  
  561.  
  562. ACT_VM_HOLSTER - Holster
  563. ACT_VM_HOLSTER_SILENCED - Holster empty, overwritten by silenced
  564. ACT_VM_HOLSTER_SILENCED - Holster silenced
  565.  
  566. ]]--
  567.  
  568. --[[Stuff you SHOULD NOT touch after this]]--
  569.  
  570. --Allowed VAnimations. These are autodetected, so not really needed except as an extra precaution. Do NOT change these, unless absolutely necessary.
  571.  
  572. SWEP.CanDrawAnimate=true
  573. SWEP.CanDrawAnimateEmpty=false
  574. SWEP.CanDrawAnimateSilenced=false
  575. SWEP.CanHolsterAnimate=true
  576. SWEP.CanHolsterAnimateEmpty=false
  577. SWEP.CanIdleAnimate=true
  578. SWEP.CanIdleAnimateEmpty=false
  579. SWEP.CanIdleAnimateSilenced=false
  580. SWEP.CanShootAnimate=true
  581. SWEP.CanShootAnimateSilenced=false
  582. SWEP.CanReloadAnimate=true
  583. SWEP.CanReloadAnimateEmpty=false
  584. SWEP.CanReloadAnimateSilenced=false
  585. SWEP.CanDryFireAnimate=false
  586. SWEP.CanDryFireAnimateSilenced=false
  587. SWEP.CanSilencerAttachAnimate=false
  588. SWEP.CanSilencerDetachAnimate=false
  589.  
  590. --Misc
  591.  
  592. SWEP.ShouldDrawAmmoHUD=false--THIS IS PROCEDURALLY CHANGED AND SHOULD NOT BE TWEAKED. BASE DEPENDENT VALUE. DO NOT CHANGE OR THINGS MAY BREAK. NO USE TO YOU.
  593. SWEP.DefaultFOV=90 --BASE DEPENDENT VALUE. DO NOT CHANGE OR THINGS MAY BREAK. NO USE TO YOU.
  594.  
  595. --Disable secondary crap
  596.  
  597. SWEP.Secondary.ClipSize = 0 -- Size of a clip
  598. SWEP.Secondary.DefaultClip = 0 -- Default ammo to give...
  599. SWEP.Secondary.Automatic = false -- Automatic/Semi Auto
  600. SWEP.Secondary.Ammo = "none" -- Self explanitory, ammo type.
  601.  
  602. --Convar support
  603.  
  604. SWEP.ConDamageMultiplier = 1
  605.  
  606. SWEP.Base = "tfa_gun_base"
  607.  
  608. SWEP.ViewModelBoneMods = {
  609. ["ValveBiped.Bip01_L_Finger02"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(0, 2.421, 0) },
  610. ["v_weapon.awm_parent"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
  611. ["ValveBiped.Bip01_L_Clavicle"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0.231, -0.128), angle = Angle(0, 0, 0) },
  612. ["ValveBiped.Bip01_L_Finger01"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(0, -6.794, 0) },
  613. ["ValveBiped.Bip01_L_Finger0"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(0, 3.917, 0) }
  614. }
  615.  
  616. SWEP.VElements = {
  617. ["element_name"] = { type = "Model", model = "models/swbf3/outerrim/weapons/bowcaster.mdl", bone = "v_weapon.awm_parent", rel = "", pos = Vector(0, 2.493, -2.595), angle = Angle(-86.223, 90, 0), size = Vector(1.202, 1.202, 1.202), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
  618. }
  619.  
  620. SWEP.WElements = {
  621. ["w_element_name"] = { type = "Model", model = "models/swbf3/outerrim/weapons/bowcaster.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(6.449, 1.248, 2.582), angle = Angle(-5.074, 3.872, 180), size = Vector(1.202, 1.202, 1.202), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
  622. }
  623.  
  624. SWEP.ShowWorldModel = false
  625.  
  626.  
  627. SWEP.Callback = {}
  628. SWEP.Callback.ChooseProceduralReloadAnim = function(self)
  629. self:EmitSound("weapons/shared/standard_reload.ogg")
  630. end
  631. SWEP.Primary.ReloadSound = Sound ("weapons/shared/standard_reload.ogg");
  632.  
  633. SWEP.DoProceduralReload = true --Do we reload using lua instead of a .mdl animation
  634. SWEP.ProceduralReloadTime = 3 --Time to take when procedurally reloading, including transition in (but not out)
  635.  
  636. SWEP.ImpactDecal = "FadingScorch"
  637.  
  638. function SWEP:DrawHands()
  639. self.UseHandsDefault = self.UseHandsDefault or self.UseHands
  640. if !self.UseHandsDefault then return end
  641. if !IsValid(self) or !self:OwnerIsValid() then return end
  642. local vm = self.OwnerViewModel
  643. if !IsValid(vm) then return end
  644.  
  645. if !IsValid(self.Owner.SWHands) then
  646. self.Owner.SWHands = ClientsideModel("models/weapons/c_clonearms.mdl")
  647. self.Owner.SWHands:SetParent(vm)
  648. self.Owner.SWHands:SetPos(self.Owner:GetShootPos())
  649. self.Owner.SWHands:SetAngles(self.Owner:EyeAngles())
  650. self.Owner.SWHands:AddEffects( EF_BONEMERGE )
  651. self.Owner.SWHands:SetNoDraw(true)
  652. self.Owner.SWHands.BoneMergedEnt = vm
  653. elseif self.Owner.SWHands:GetParent() != vm then
  654. self.Owner.SWHands:SetModel("models/weapons/c_clonearms.mdl")
  655. self.Owner.SWHands:SetParent(vm)
  656. self.Owner.SWHands:SetPos(self.Owner:GetShootPos())
  657. self.Owner.SWHands:SetAngles(self.Owner:EyeAngles())
  658. self.Owner.SWHands:AddEffects( EF_BONEMERGE )
  659. elseif self.Owner.SWHands:GetModel()!="models/weapons/c_clonearms.mdl" then
  660. self.Owner.SWHands:SetModel("models/weapons/c_clonearms.mdl")
  661. end
  662.  
  663. if self.Owner.SWHands then
  664. self.Owner.SWHands:DrawModel()
  665. end
  666.  
  667. self.UseHands = false
  668.  
  669. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement