Guest User

tfa_csgo_ak47

a guest
Jul 12th, 2019
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.25 KB | None | 0 0
  1. SWEP.Base               = "tfa_csgo_base"
  2. SWEP.Category               = "TFA CS:GO" --The category.  Please, just choose something generic or something I've already done if you plan on only doing like one swep.
  3. SWEP.Author             = "" --Author Tooltip
  4. SWEP.Contact                = "" --Contact Info Tooltip
  5. SWEP.Purpose                = "" --Purpose Tooltip
  6. SWEP.Instructions               = "" --Instructions Tooltip
  7. SWEP.Spawnable              = true --Can you, as a normal user, spawn this?
  8. 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.
  9. SWEP.DrawCrosshair          = true      -- Draw the crosshair?
  10. SWEP.PrintName              = "AK-47"       -- Weapon name (Shown on HUD)
  11. SWEP.Slot               = 2             -- Slot in the weapon selection menu.  Subtract 1, as this starts at 0.
  12. SWEP.SlotPos                = 73            -- Position in the slot
  13. SWEP.DrawAmmo               = true      -- Should draw the default HL2 ammo counter if enabled in the GUI.
  14. SWEP.DrawWeaponInfoBox          = false     -- Should draw the weapon info box
  15. SWEP.BounceWeaponIcon           =   false   -- Should the weapon icon bounce?
  16. SWEP.AutoSwitchTo           = true      -- Auto switch to if we pick it up
  17. SWEP.AutoSwitchFrom         = true      -- Auto switch from if you pick up a better weapon
  18. SWEP.Weight             = 30            -- This controls how "good" the weapon is for autopickup.
  19.  
  20. --[[WEAPON HANDLING]]--
  21.  
  22. --Firing related
  23. SWEP.Primary.Sound          = Sound("TFA_CSGO_AK47.1")              -- This is the sound of the weapon, when you shoot.
  24. SWEP.Primary.PenetrationMultiplier = 1 --Change the amount of something this gun can penetrate through
  25. SWEP.Primary.Damage     = 36                    -- Damage, in standard damage points.
  26. SWEP.DamageType = nil--See DMG enum.  This might be DMG_SHOCK, DMG_BURN, DMG_BULLET, etc.
  27. SWEP.Primary.NumShots   = 1 --The number of shots the weapon fires.  SWEP.Shotgun is NOT required for this to be >1.
  28. SWEP.Primary.Automatic          = true                  -- Automatic/Semi Auto
  29. SWEP.Primary.RPM                = 600                   -- This is in Rounds Per Minute / RPM
  30. SWEP.Primary.RPM_Semi               = nil                   -- RPM for semi-automatic or burst fire.  This is in Rounds Per Minute / RPM
  31. SWEP.FiresUnderwater = false
  32.  
  33. -- Selective Fire Stuff
  34.  
  35. SWEP.SelectiveFire      = false --Allow selecting your firemode?
  36. SWEP.DisableBurstFire   = false --Only auto/single?
  37. SWEP.OnlyBurstFire      = false --No auto, only burst/single?
  38. SWEP.DefaultFireMode    = "" --Default to auto or whatev
  39.  
  40. --Ammo Related
  41.  
  42. SWEP.Primary.ClipSize           = 30                    -- This is the size of a clip
  43. SWEP.Primary.DefaultClip            = 30                    -- This is the number of bullets the gun gives you, counting a clip as defined directly above.
  44. SWEP.Primary.Ammo           = "ar2"                 -- What kind of ammo.  Options, besides custom, include pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, and AirboatGun.
  45. --Pistol, buckshot, and slam like to ricochet. Use AirboatGun for a light metal peircing shotgun pellets
  46. SWEP.NearlyEmpty_ClipSize = 5
  47.  
  48. SWEP.DisableChambering = false --Disable round-in-the-chamber
  49.  
  50. --Recoil Related
  51. SWEP.Primary.KickUp         = 0.45                  -- This is the maximum upwards recoil (rise)
  52. SWEP.Primary.KickDown           = 0.4                   -- This is the maximum downwards recoil (skeet)
  53. SWEP.Primary.KickHorizontal         = 0.5                   -- This is the maximum sideways recoil (no real term)
  54. SWEP.Primary.StaticRecoilFactor = 0.5   --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.
  55.  
  56. --Firing Cone Related
  57.  
  58. SWEP.Primary.Spread     = .01                   --This is hip-fire acuracy.  Less is more (1 is horribly awful, .0001 is close to perfect)
  59. SWEP.Primary.IronAccuracy = .005    -- Ironsight accuracy, should be the same for shotguns
  60.  
  61. --Unless you can do this manually, autodetect it.  If you decide to manually do these, uncomment this block and remove this line.
  62.  
  63. SWEP.Primary.SpreadMultiplierMax = 10 --How far the spread can expand when you shoot.
  64. SWEP.Primary.SpreadIncrement = 2 --What percentage of the modifier is added on, per shot.
  65. SWEP.Primary.SpreadRecovery = 10 --How much the spread recovers, per second.
  66.  
  67. --Range Related
  68. SWEP.Primary.Range = -1 -- The distance the bullet can travel in source units.  Set to -1 to autodetect based on damage/rpm.
  69. SWEP.Primary.RangeFalloff = -1 -- 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.
  70.  
  71.  
  72. --Penetration Related
  73.  
  74. SWEP.MaxPenetrationCounter=4 --The maximum number of ricochets.  To prevent stack overflows.
  75.  
  76. --Misc
  77. SWEP.IronRecoilMultiplier=0.5 --Multiply recoil by this factor when we're in ironsights.  This is proportional, not inversely.
  78. SWEP.CrouchRecoilMultiplier=0.65  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
  79. SWEP.JumpRecoilMultiplier=1.3  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
  80. SWEP.WallRecoilMultiplier=1.1  --Multiply recoil by this factor when we're changing state e.g. not completely ironsighted.  This is proportional, not inversely.
  81. SWEP.ChangeStateRecoilMultiplier=1.3  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
  82. SWEP.CrouchAccuracyMultiplier=0.5--Less is more.  Accuracy * 0.5 = Twice as accurate, Accuracy * 0.1 = Ten times as accurate
  83. 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
  84. SWEP.JumpAccuracyMultiplier=2--Less is more.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
  85. SWEP.WalkAccuracyMultiplier=1.35--Less is more.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
  86. SWEP.IronSightTime = 0.3 --The time to enter ironsights/exit it.
  87. SWEP.NearWallTime = 0.25 --The time to pull up  your weapon or put it back down
  88. SWEP.ToCrouchTime = 0.05 --The time it takes to enter crouching state
  89. 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.
  90. SWEP.MoveSpeed = 215/260 --Multiply the player's movespeed by this.
  91. SWEP.IronSightsMoveSpeed  = 215/260*0.8 --Multiply the player's movespeed by this when sighting.
  92. SWEP.SprintFOVOffset = 3.75 --Add this onto the FOV when we're sprinting.
  93.  
  94. --[[PROJECTILES]]--
  95.  
  96. SWEP.ProjectileEntity = nil --Entity to shoot
  97. SWEP.ProjectileVelocity = 0 --Entity to shoot's velocity
  98. SWEP.LuaShellEject = true --Entity to shoot's model
  99. SWEP.LuaShellEffect = "RifleShellEject" --Defaults to blowback
  100.  
  101. --[[VIEWMODEL]]--
  102.  
  103. SWEP.ViewModel          = "models/weapons/tfa_csgo/c_rif_ak47.mdl" --Viewmodel path
  104. SWEP.ViewModelFOV       = 56        -- This controls how big the viewmodel looks.  Less is more.
  105. SWEP.ViewModelFlip          = false     -- Set this to true for CSS models, or false for everything else (with a righthanded viewmodel.)
  106. SWEP.UseHands = true --Use gmod c_arms system.
  107.  
  108.  
  109.  
  110. --[[WORLDMODEL]]--
  111.  
  112. SWEP.WorldModel         = "models/weapons/tfa_csgo/w_ak47.mdl" -- Weapon world model path
  113.  
  114. SWEP.HoldType               = "ar2"     -- This is how others view you carrying the weapon. Options include:
  115. -- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
  116. -- You're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles
  117.  
  118. SWEP.Offset = { --Procedural world model animation, defaulted for CS:S purposes.
  119.         Pos = {
  120.         Up = -1.6,
  121.         Right = 1.2,
  122.         Forward = 6,
  123.         },
  124.         Ang = {
  125.         Up = 7,
  126.         Right = 83,
  127.         Forward = 178
  128.         },
  129.         Scale = 1
  130. }
  131.  
  132. SWEP.ThirdPersonReloadDisable=false --Disable third person reload?  True disables.
  133.  
  134. --[[SCOPES]]--
  135.  
  136. SWEP.BoltAction         = false  --Unscope/sight after you shoot?
  137. SWEP.Scoped             = false  --Draw a scope overlay?
  138.  
  139. SWEP.ScopeOverlayThreshold = 0.875 --Percentage you have to be sighted in to see the scope.
  140. SWEP.BoltTimerOffset = 0.25 --How long you stay sighted in after shooting, with a bolt action.
  141.  
  142. SWEP.ScopeScale = 0.5 --Scale of the scope overlay
  143. SWEP.ReticleScale = 0.7 --Scale of the reticle overlay
  144.  
  145. --GDCW Overlay Options.  Only choose one.
  146.  
  147. SWEP.Secondary.UseACOG          = false  --Overlay option
  148. SWEP.Secondary.UseMilDot            = false          --Overlay option
  149. SWEP.Secondary.UseSVD           = false      --Overlay option
  150. SWEP.Secondary.UseParabolic     = false      --Overlay option
  151. SWEP.Secondary.UseElcan         = false  --Overlay option
  152. SWEP.Secondary.UseGreenDuplex       = false      --Overlay option
  153.  
  154. --[[SHOTGUN CODE]]--
  155.  
  156. SWEP.Shotgun = false --Enable shotgun style reloading.
  157.  
  158. SWEP.ShellTime          = .35 -- For shotguns, how long it takes to insert a shell.
  159.  
  160. --[[SPRINTING]]--
  161.  
  162. SWEP.RunSightsPos = Vector(0, 0, 0)
  163. SWEP.RunSightsAng = Vector(-11.869, 17.129, -16.056)
  164.  
  165. --[[IRONSIGHTS]]--
  166.  
  167. SWEP.data               = {}
  168. SWEP.data.ironsights            = 1 --Enable Ironsights
  169. SWEP.Secondary.IronFOV          = 60                    -- How much you 'zoom' in. Less is more!  Don't have this be <= 0.  A good value for ironsights is like 70.
  170.  
  171. SWEP.IronSightsPos = Vector(-4.980, -4, 0.821)
  172. SWEP.IronSightsAng = Vector(1.115, 0.134, -2)
  173.  
  174. --[[INSPECTION]]--
  175.  
  176. --SWEP.InspectPos = Vector(0,0,0) --Replace with a vector, in style of ironsights position, to be used for inspection
  177. --SWEP.InspectAng = Vector(0,0,0) --Replace with a vector, in style of ironsights angle, to be used for inspection
  178. SWEP.FidgetLoop = false --Setting false will cancel inspection once the animation is done.  CS:GO style.
  179.  
  180. --[[VIEWMODEL ANIMATION HANDLING]]--
  181.  
  182. SWEP.ShootWhileDraw=false --Can you shoot while draw anim plays?
  183. SWEP.AllowReloadWhileDraw=false --Can you reload while draw anim plays?
  184. SWEP.SightWhileDraw=false --Can we sight in while the weapon is drawing / the draw anim plays?
  185. SWEP.AllowReloadWhileHolster=false --Can we interrupt holstering for reloading?
  186. SWEP.ShootWhileHolster=false --Cam we interrupt holstering for shooting?
  187. SWEP.SightWhileHolster=false --Cancel out "iron"sights when we holster?
  188. SWEP.UnSightOnReload=true --Cancel out ironsights for reloading.
  189. SWEP.AllowReloadWhileSprinting=false --Can you reload when close to a wall and facing it?
  190. SWEP.AllowReloadWhileNearWall=false --Can you reload when close to a wall and facing it?
  191. SWEP.SprintBobMult=1.5 -- More is more bobbing, proportionally.  This is multiplication, not addition.  You want to make this > 1 probably for sprinting.
  192. 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.
  193. 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
  194.  
  195.  
  196. --[[VIEWMODEL BLOWBACK]]--
  197.  
  198. SWEP.BlowbackEnabled = true --Enable Blowback?
  199. SWEP.BlowbackVector = Vector(0,-2,0) --Vector to move bone <or root> relative to bone <or view> orientation.
  200. SWEP.BlowbackCurrentRoot = 0 --Amount of blowback currently, for root
  201. SWEP.BlowbackCurrent = 0 --Amount of blowback currently, for bones
  202. SWEP.BlowbackBoneMods = {
  203.     ["v_weapon.AK47_bolt"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, -3.922), angle = Angle(0, 0, 0) }
  204. }
  205. SWEP.Blowback_Only_Iron = true --Only do blowback on ironsights
  206. SWEP.Blowback_PistolMode = false --Do we recover from blowback when empty?
  207. SWEP.Blowback_Shell_Enabled = true
  208. SWEP.Blowback_Shell_Effect = "RifleShellEject"
  209.  
  210. --[[HOLDTYPES]]--
  211.  
  212. SWEP.IronSightHoldTypeOverride=""  --This variable overrides the ironsights holdtype, choosing it instead of something from the above tables.  Change it to "" to disable.
  213. SWEP.SprintHoldTypeOverride=""  --This variable overrides the sprint holdtype, choosing it instead of something from the above tables.  Change it to "" to disable.
  214.  
  215. --[[ANIMATION]]--
  216.  
  217. SWEP.ForceDryFireOff = true --Disables dryfire.  Set to false to enable them.
  218. SWEP.DisableIdleAnimations = false --Disables idle animations.  Set to false to enable them.
  219. SWEP.ForceEmptyFireOff = true --Disables empty fire animations.  Set to false to enable them.
  220.  
  221. --If you really want, you can remove things from SWEP.actlist and manually enable animations and set their lengths.
  222.  
  223. SWEP.SequenceEnabled = {} --Self explanitory.  This can forcefully enable or disable a certain ACT_VM
  224. SWEP.SequenceLength = {}  --This controls the length of a certain ACT_VM
  225. SWEP.SequenceLengthOverride={} --Override this if you want to change the length of a sequence but not the next idle
  226. SWEP.StatusLengthOverride = {
  227.     [ACT_VM_RELOAD] = 35 / 30
  228. }
  229.  
  230. --[[EFFECTS]]--
  231.  
  232. --Muzzle Smoke
  233.  
  234.  
  235.  
  236.  
  237. --Muzzle Flash
  238.  
  239. SWEP.MuzzleAttachment           = "1"       -- Should be "1" for CSS models or "muzzle" for hl2 models
  240. --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.
  241. SWEP.ShellAttachment            = "2"       -- Should be "2" for CSS models or "shell" for hl2 models
  242.  
  243. SWEP.DoMuzzleFlash = true --Do a muzzle flash?
  244. SWEP.CustomMuzzleFlash = true --Disable muzzle anim events and use our custom flashes?
  245. SWEP.AutoDetectMuzzleAttachment = false --For multi-barrel weapons, detect the proper attachment?
  246. SWEP.MuzzleFlashEffect = "tfa_csgo_muzzle_assaultrifle" --Change to a string of your muzzle flash effect.  Copy/paste one of the existing from the base.
  247.  
  248. --Tracer Stuff
  249.  
  250. SWEP.Tracer             = 0     --Bullet tracer.  TracerName overrides this.
  251. SWEP.TracerCount        = 3     --0 disables, otherwise, 1 in X chance
  252.  
  253. --[[EVENT TABLE]]--
  254.  
  255. SWEP.MagModel = Model("models/weapons/tfa_csgo/w_rif_ak47_mag.mdl")
  256. SWEP.EventTable = {
  257.     [ACT_VM_RELOAD] = {
  258.         { time = 22 / 30, type = "lua", value = function(wep,vm) wep:DropMag() end, client = true, server = true }
  259.     }
  260. } --Event Table, used for custom events when an action is played.  This can even do stuff like playing a pump animation after shooting.
  261.  
  262. --example:
  263. --SWEP.EventTable = {
  264. --  [ACT_VM_RELOAD] = {
  265. --      { ['time'] = 0.1, ['type'] = "lua", ['value'] = examplefunction, ['client'] = true, ['server'] = false  },
  266. --      { ['time'] = 0.2, ['type'] = "sound", ['value'] = Sound("ExampleGun.Sound1", ['client'] = true, ['server'] = false ) }
  267. --  }
  268. --}
  269.  
  270.  
  271. --[[RENDER TARGET]]--
  272.  
  273. SWEP.RTMaterialOverride = nil -- Take the material you want out of print(LocalPlayer():GetViewModel():GetMaterials()), subtract 1 from its index, and set it to this.
  274.  
  275. SWEP.RTOpaque = false -- Do you want your render target to be opaque?
  276.  
  277. SWEP.RTCode = function( self ) --This is the function to draw onto your rendertarget
  278.  
  279.     return
  280.  
  281. end
  282.  
  283. --[[AKIMBO]]--
  284.  
  285. SWEP.Akimbo = false --Akimbo gun?  Alternates between primary and secondary attacks.
  286. SWEP.AnimCycle = 0 -- Start on the right
  287.  
  288. --[[TTT]]--
  289.  
  290. local gm = engine.ActiveGamemode()
  291. if string.find(gm,"ttt") or string.find(gm,"terrortown") then
  292.     SWEP.Kind = WEAPON_HEAVY
  293.     SWEP.AutoSpawnable = true
  294.     SWEP.AllowDrop = true
  295.     SWEP.AmmoEnt = "item_ammo_smg1_ttt"
  296. end
  297.  
  298. --[[MISC INFO FOR MODELERS]]--
  299.  
  300. --[[
  301.  
  302. Used Animations (for modelers):
  303.  
  304. ACT_VM_DRAW - Draw
  305. ACT_VM_DRAW_EMPTY - Draw empty
  306. ACT_VM_DRAW_SILENCED - Draw silenced, overrides empty
  307.  
  308. ACT_VM_IDLE - Idle
  309. ACT_VM_IDLE_SILENCED - Idle empty, overwritten by silenced
  310. ACT_VM_IDLE_SILENCED - Idle silenced
  311.  
  312. ACT_VM_PRIMARYATTACK - Shoot
  313. ACT_VM_PRIMARYATTACK_EMPTY - Shoot last chambered bullet
  314. ACT_VM_PRIMARYATTACK_SILENCED - Shoot silenced, overrides empty
  315. ACT_VM_PRIMARYATTACK_1 - Shoot ironsights, overriden by everything besides normal shooting
  316. ACT_VM_DRYFIRE - Dryfire
  317.  
  318. ACT_VM_RELOAD - Reload / Tactical Reload / Insert Shotgun Shell
  319. ACT_SHOTGUN_RELOAD_START - Start shotgun reload, unless ACT_VM_RELOAD_EMPTY is there.
  320. ACT_SHOTGUN_RELOAD_FINISH - End shotgun reload.
  321. ACT_VM_RELOAD_EMPTY - Empty mag reload, chambers the new round.  Works for shotguns too, where applicable.
  322. ACT_VM_RELOAD_SILENCED - Silenced reload, overwrites all
  323.  
  324.  
  325. ACT_VM_HOLSTER - Holster
  326. ACT_VM_HOLSTER_SILENCED - Holster empty, overwritten by silenced
  327. ACT_VM_HOLSTER_SILENCED - Holster silenced
  328.  
  329. ]]--
  330.  
  331. --[[Stuff you SHOULD NOT touch after this]]--
  332.  
  333. --Allowed VAnimations.  These are autodetected, so not really needed except as an extra precaution.  Do NOT change these, unless absolutely necessary.
  334.  
  335. SWEP.CanDrawAnimate=true
  336. SWEP.CanDrawAnimateEmpty=false
  337. SWEP.CanDrawAnimateSilenced=false
  338. SWEP.CanHolsterAnimate=true
  339. SWEP.CanHolsterAnimateEmpty=false
  340. SWEP.CanIdleAnimate=true
  341. SWEP.CanIdleAnimateEmpty=false
  342. SWEP.CanIdleAnimateSilenced=false
  343. SWEP.CanShootAnimate=true
  344. SWEP.CanShootAnimateSilenced=false
  345. SWEP.CanReloadAnimate=true
  346. SWEP.CanReloadAnimateEmpty=false
  347. SWEP.CanReloadAnimateSilenced=false
  348. SWEP.CanDryFireAnimate=false
  349. SWEP.CanDryFireAnimateSilenced=false
  350. SWEP.CanSilencerAttachAnimate=false
  351. SWEP.CanSilencerDetachAnimate=false
  352.  
  353. --Misc
  354.  
  355. 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.
  356. SWEP.DefaultFOV=90 --BASE DEPENDENT VALUE.  DO NOT CHANGE OR THINGS MAY BREAK.  NO USE TO YOU.
  357.  
  358. --Disable secondary crap
  359.  
  360. SWEP.Secondary.ClipSize         = 0                 -- Size of a clip
  361. SWEP.Secondary.DefaultClip          = 0                 -- Default ammo to give...
  362. SWEP.Secondary.Automatic            = false                 -- Automatic/Semi Auto
  363. SWEP.Secondary.Ammo         = "none" -- Self explanitory, ammo type.
  364.  
  365. --Convar support
  366.  
  367. SWEP.ConDamageMultiplier = 1
  368.  
  369. SWEP.Base               = "tfa_csgo_base"
Advertisement
Add Comment
Please, Sign In to add comment