ZOUK_AG

Roblox Studio M4A1 Script

May 31st, 2020
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.83 KB | None | 0 0
  1. --[[ Edited Version
  2. ====================================================================================================
  3. Weapons and Tools Pack 2016's Gun by SuperEvilAzmil and edited by thienbao2109
  4.  
  5. Features:
  6. - FilteringEnabled support
  7. - Easy to edit with a bunch of settings
  8. - No delays between Mouse Click and Gun Fire
  9. ====================================================================================================
  10. ]]
  11.  
  12. local Module = {
  13. -- ====================
  14. -- BASIC
  15. -- A basic settings for the gun
  16. -- ====================
  17.  
  18. Auto = true;
  19. BaseDamage = 20;
  20. FireRate = 0.09; --In second
  21. ReloadTime = 3.5; --In second
  22. AmmoPerMag = 999999999999999999999999999999999999999999999; --Put "math.huge" to make this gun has infinite ammo and never reload
  23. Spread = 4; --In degree
  24. Range = 5000; --The furthest distance the bullet can travel
  25. HeadshotEnabled = true; --Enable the gun to do extra damage on headshot
  26. HeadshotDamageMultiplier = 2;
  27. EquipTime = 0; --In second
  28. IdleAnimationID = 740934097; --Set to "nil" if you don't want to animate
  29. IdleAnimationSpeed = 1;
  30. FireAnimationID = 740938913; --Set to "nil" if you don't want to animate
  31. FireAnimationSpeed = 1;
  32. ReloadAnimationID = 740975980; --Set to "nil" if you don't want to animate
  33. ReloadAnimationSpeed = 0.35;
  34. EquippedAnimationID = nil; --Set to "nil" if you don't want to animate
  35. EquippedAnimationSpeed = 1;
  36.  
  37. --Enable the user to play second animation. Useful for dual wield
  38. SecondaryFireAnimationEnabled = false; --You need an animation ID in order to enable it
  39. SecondaryFireAnimationID = nil; --Set to "nil" if you don't want to animate
  40. SecondaryFireAnimationSpeed = 1;
  41.  
  42. --Enable the user to play aim animations
  43. AimAnimationsEnabled = false;
  44. AimIdleAnimationID = nil; --Set to "nil" if you don't want to animate
  45. AimIdleAnimationSpeed = 1;
  46. AimFireAnimationID = nil; --Set to "nil" if you don't want to animate
  47. AimFireAnimationSpeed = 1;
  48. AimSecondaryFireAnimationID = nil; --Set to "nil" if you don't want to animate. NOTE: Make sure "SecondaryFireAnimation" setting is enabled
  49. AimSecondaryFireAnimationSpeed = 1;
  50.  
  51. -- ====================
  52. -- DAMAGE DROPOFF
  53. -- Calculate how the damage of a single shot decreases when the target hit is at a distance away from the gun shot. NOTE: This setting won't apply with "ExplosiveEnabled"
  54. -- ====================
  55.  
  56. DamageDropOffEnabled = false;
  57. ZeroDamageDistance = 10000; --Anything hit at or beyond this distance will receive no damage; default is 10000
  58. FullDamageDistance = 1000; --Maximum distance that shots will do full damage. Default is 1000 and anything hit beyond this distance will receive less and less damage as the distance nears "ZeroDamageDistance"
  59.  
  60. -- ====================
  61. -- GORE VISUALIZER
  62. -- Create gore effect when humanoid died
  63. -- ====================
  64.  
  65. GoreEffectEnabled = false;
  66. GoreSoundIDs = {1930359546};
  67. GoreSoundPitchMin = 1; --Minimum pitch factor you will acquire
  68. GoreSoundPitchMax = 1.5; --Maximum pitch factor you will acquire
  69. GoreSoundVolume = 1;
  70.  
  71. -- ====================
  72. -- CRITICAL DAMAGE
  73. -- Damage critically within its chance
  74. -- ====================
  75.  
  76. CriticalDamageEnabled = false;
  77. CriticalBaseChance = 5; --In percent
  78. CriticalDamageMultiplier = 3;
  79.  
  80. -- ====================
  81. -- FIRE SOUND EFFECTS
  82. -- Special effects for fire sound
  83. -- ====================
  84.  
  85. SilenceEffect = false; --Lower volume
  86. EchoEffect = true; --Create echo effect from distance
  87.  
  88. -- ====================
  89. -- WALK SPEED REDUTION
  90. -- Nerf chraracter's walk speed when equip the gun
  91. -- ====================
  92.  
  93. WalkSpeedRedutionEnabled = false;
  94. WalkSpeedRedution = 6;
  95.  
  96. -- ====================
  97. -- TACTICAL RELOAD ANIMATION
  98. -- Reload the gun that has only fired a few rounds out of its magazine
  99. -- ====================
  100.  
  101. TacticalReloadAnimationEnabled = false;
  102. TacticalReloadAnimationID = nil; --Set to "nil" if you don't want to animate
  103. TacticalReloadAnimationSpeed = 1;
  104.  
  105. -- ====================
  106. -- HOLD DOWN ANIMATION
  107. -- Character won't fire if hold down the gun
  108. -- ====================
  109.  
  110. HoldDownEnabled = true;
  111. HoldDownAnimationID = 1637489010;
  112. HoldDownAnimationSpeed = 0.5;
  113.  
  114. -- ====================
  115. -- BULLET HOLE VISUALIZER
  116. -- Create a bullet hole when a bullet hit something but not character
  117. -- ====================
  118.  
  119. BulletHoleEnabled = true;
  120. BulletHoleSize = 0.5;
  121. BulletHoleTexture = {2078626}; --You can insert more IDs
  122. BulletHoleVisibleTime = 3; --In second
  123. BulletHoleFadeTime = 1; --In second
  124. PartColor = true; --Set to hit object color
  125.  
  126. -- ====================
  127. -- HIT VISUALIZER
  128. -- Create hit effect when a bullet hit something but not character(And hit sound, too)
  129. -- ====================
  130.  
  131. HitEffectEnabled = true;
  132. HitSoundIDs = {186809061, 186809249, 186809250, 186809252};
  133. HitSoundPitchMin = 1; --Minimum pitch factor you will acquire
  134. HitSoundPitchMax = 1.5; --Maximum pitch factor you will acquire
  135. HitSoundVolume = 1;
  136. CustomHitEffect = false; --Emits your custom hit effect. NOTE: If you this setting disabled, hit effect will set to default(material tracker included)
  137. AlignHitEffectToNormal = true; --Make effect face straight out from surface where projectile hit. Good for things like arrows if it disabled
  138.  
  139. -- ====================
  140. -- BLOOD VISUALIZER
  141. -- Create blood when a bullet hit character(And hit character sound, too)
  142. -- ====================
  143.  
  144. BloodEnabled = true;
  145. HitCharSndIDs = {3802437008, 3802437361, 3802437696, 3802440043, 3802440388, 3802442962};
  146. HitCharSndPitchMin = 1; --Minimum pitch factor you will acquire
  147. HitCharSndPitchMax = 1; --Maximum pitch factor you will acquire
  148. HitCharSndVolume = 1;
  149. AlignBloodEffectToNormal = true; --Make effect face straight out from surface where projectile hit. Good for things like arrows if it disabled
  150.  
  151. -- ====================
  152. -- TWEEN SETTING
  153. -- Part of ironsight and sniper aim
  154. -- ====================
  155.  
  156. TweenLength = 0.8; --In second
  157. EasingStyle = Enum.EasingStyle.Quint; --Linear, Sine, Back, Quad, Quart, Quint, Bounce or Elastic?
  158. EasingDirection = Enum.EasingDirection.Out; --In, Out or InOut?
  159.  
  160. -- ====================
  161. -- TWEEN SETTING(NO AIM DOWN)
  162. -- Part of ironsight and sniper aim
  163. -- ====================
  164.  
  165. TweenLengthNAD = 0.8; --In second
  166. EasingStyleNAD = Enum.EasingStyle.Quint; --Linear, Sine, Back, Quad, Quart, Quint, Bounce or Elastic?
  167. EasingDirectionNAD = Enum.EasingDirection.Out; --In, Out or InOut?
  168.  
  169. -- ====================
  170. -- BULLET WHIZZING SOUND
  171. -- Create a sound when a bullet travelling through character
  172. -- ====================
  173.  
  174. WhizSoundEnabled = true;
  175. WhizSoundID = {3809084884, 3809085250, 3809085650, 3809085996, 3809086455};
  176. WhizSoundVolume = 1;
  177. WhizSoundPitchMin = 1; --Minimum pitch factor you will acquire
  178. WhizSoundPitchMax = 1; --Maximum pitch factor you will acquire
  179. WhizDistance = 25;
  180.  
  181. -- Make sure "CanMovePart" is enabled. Otherwise, it won't work
  182.  
  183. -- ====================
  184. -- HITMARKER
  185. -- Mark on somewhere when a bullet hit character
  186. -- ====================
  187.  
  188. HitmarkerEnabled = true;
  189. HitmarkerSoundID = {3748776946, 3748777642, 3748780065};
  190. --Normal
  191. HitmarkerColor = Color3.fromRGB(255, 255, 255);
  192. HitmarkerFadeTime = 0.4;
  193. HitmarkerSoundPitch = 1;
  194. --Headshot
  195. HitmarkerColorHS = Color3.fromRGB(255, 0, 0);
  196. HitmarkerFadeTimeHS = 0.4;
  197. HitmarkerSoundPitchHS = 1;
  198.  
  199. -- ====================
  200. -- CROSSHAIR
  201. -- A gun cursor
  202. -- ====================
  203.  
  204. CrossSize = 5;
  205. CrossExpansion = 50;
  206. CrossSpeed = 15;
  207. CrossDamper = 0.8;
  208.  
  209. -- ====================
  210. -- MUZZLE
  211. -- Create a muzzle flash when firing
  212. -- ====================
  213.  
  214. MuzzleFlashEnabled = true;
  215. MuzzleLightEnabled = true;
  216. LightBrightness = 4;
  217. LightColor = Color3.new(255/255, 283/255, 0/255);
  218. LightRange = 15;
  219. LightShadows = true;
  220. VisibleTime = 0.01; --In second
  221.  
  222. -- ====================
  223. -- BULLET SHELL EJECTION
  224. -- Eject bullet shells when firing
  225. -- ====================
  226.  
  227. BulletShellEnabled = true;
  228. BulletShellOffset = Vector3.new(0, 0.4, -1);
  229. ShellSize = Vector3.new(0.2, 0.2, 0.62); --Scale the part
  230. AllowCollide = false; --If false, a bullet shell will go through any parts
  231. ShellScale = Vector3.new(4, 4, 4); --Scale mesh
  232. ShellMeshID = 94295100;
  233. ShellTextureID = 94287792;
  234. DisappearTime = 5; --In second
  235.  
  236. -- You can edit velocity by go to GunScript_Local, and scroll down until you see "function EjectShell(ShootingHandle)"
  237.  
  238. -- ====================
  239. -- IRONSIGHT
  240. -- Allow user to ironsighting
  241. -- ====================
  242.  
  243. IronsightEnabled = true; --NOTE: If "SniperEnabled" is enabled, this setting is not work
  244. FieldOfViewIS = 50;
  245. MouseSensitiveIS = 0.2; --In percent
  246. SpreadRedutionIS = 0.6; --In percent. NOTE: Must be the same value as "SpreadRedutionS"
  247. CrossScaleIS = 0.6;
  248.  
  249. -- ====================
  250. -- LIMITED AMMO
  251. -- Make a gun has a limit ammo
  252. -- ====================
  253.  
  254. LimitedAmmoEnabled = true;
  255. Ammo = 120;
  256. MaxAmmo = 120; --Put "math.huge" to allow user to carry unlimited ammo
  257.  
  258. -- ====================
  259. -- SHOTGUN
  260. -- Enable the gun to fire multiple bullet in one shot
  261. -- ====================
  262.  
  263. ShotgunEnabled = false;
  264. BulletPerShot = 8;
  265.  
  266. ShotgunPump = false; --Make user pumping like Shotgun after firing
  267. ShotgunPumpinAnimationID = nil; --Set to "nil" if you don't want to animate
  268. ShotgunPumpinAnimationSpeed = 1;
  269. ShotgunPumpinSpeed = 0.5; --In second
  270. SecondaryShotgunPump = false; --Only for dual wield
  271. SecondaryShotgunPumpinAnimationID = nil; --Set to "nil" if you don't want to animate
  272. SecondaryShotgunPumpinAnimationSpeed = 1;
  273. SecondaryShotgunPumpinSpeed = 0.5; --In second
  274.  
  275. ShotgunReload = false; --Make user reloading like Shotgun, which user clipin shell one by one
  276. ShotgunClipinAnimationID = nil; --Set to "nil" if you don't want to animate
  277. ShotgunClipinAnimationSpeed = 1;
  278. ShellClipinSpeed = 0.5; --In second
  279.  
  280. ShotgunPattern = false;
  281. SpreadPattern = { --{x, y}. This should be the same as "BulletPerShot"
  282. -- inner 3
  283. {0, -0.4};
  284. {-0.35, 0.2};
  285. {0.35, 0.2};
  286.  
  287. -- outer five
  288. {0, 1};
  289. {0.95, 0.31};
  290. {0.59, -0.81};
  291. {-0.59, -0.81};
  292. {-0.95, 0.31};
  293. };
  294.  
  295. -- How "ShotgunPump" works [Example 1]:
  296.  
  297. -- Fire a (shot)gun
  298. -- >>>
  299. -- After "FireRate", user will pump it, creates pumpin delay + "PumpSound"
  300.  
  301. -- How "ShotgunReload" works [Example 2]:
  302.  
  303. -- Play "ShotgunClipinAnimation" + Play "ShotgunClipin" Audio
  304. -- >>>
  305. -- Wait "ShellClipinSpeed" second(s)
  306. -- >>>
  307. -- Repeat "AmmoPerClip" - "Current Ammo" times
  308. -- >>>
  309. -- Play "ReloadAnimation" + Play "ReloadSound"
  310. -- >>>
  311. -- Wait "ReloadTime"
  312.  
  313. -- ====================
  314. -- BURST FIRE
  315. -- Enable the gun to do burst firing like Assault Rifle
  316. -- ====================
  317.  
  318. BurstFireEnabled = false;
  319. BulletPerBurst = 3;
  320. BurstRate = 0.075; --In second
  321.  
  322. -- ====================
  323. -- SNIPER
  324. -- Enable user to use scope
  325. -- ====================
  326.  
  327. SniperEnabled = false; --NOTE: If "IronsightEnabled" is enabled, this setting is not work
  328. FieldOfViewS = 12.5;
  329. MouseSensitiveS = 0.2; --In percent
  330. SpreadRedutionS = 0.6; --In percent. NOTE: Must be the same value as "SpreadRedutionOS"
  331. CrossScaleS = 0;
  332. ScopeSensitive = 0.25;
  333. ScopeKnockbackSpeed = 7;
  334. ScopeKnockbackDamper = 0.65;
  335. ScopeSwaySpeed = 10;
  336. ScopeSwayDamper = 0.4;
  337.  
  338. -- You can edit knockback offset by go to GunScript_Local, and scroll down until you reach line 421 and 486
  339.  
  340. -- ====================
  341. -- CAMERA RECOILING
  342. -- Make user's camera recoiling when shooting
  343. -- ====================
  344.  
  345. CameraRecoilingEnabled = true;
  346. Recoil = 30;
  347. AngleX_Min = 1; --In degree
  348. AngleX_Max = 1; --In degree
  349. AngleY_Min = -.5; --In degree
  350. AngleY_Max = .5; --In degree
  351. AngleZ_Min = -1; --In degree
  352. AngleZ_Max = 1; --In degree
  353. Accuracy = 0.1; --In percent. For example: 0.5 is 50%
  354. RecoilSpeed = 18;
  355. RecoilDamper = 0.65;
  356. RecoilRedution = 0.5; --In percent.
  357.  
  358. -- ====================
  359. -- EXPLOSIVE
  360. -- Make a bullet explosive so user can deal a damage to multiple enemy in single shot. NOTE: Explosion won't break joints
  361. -- ====================
  362.  
  363. ExplosiveEnabled = false;
  364. ExplosionSoundEnabled = true;
  365. ExplosionSoundIDs = {163064102};
  366. ExplosionSoundVolume = 1;
  367. ExplosionSoundPitchMin = 1; --Minimum pitch factor you will acquire
  368. ExplosionSoundPitchMax = 1.5; --Maximum pitch factor you will acquire
  369. ExplosionRadius = 8;
  370. DamageBasedOnDistance = false;
  371. CustomExplosion = false;
  372. AlignCustomExplosionToNormal = true; --Make effect face straight out from surface where projectile hit. Good for things like arrows if it disabled
  373.  
  374. -- ====================
  375. -- PROJECTILE VISUALIZER
  376. -- Display a travelling projectile
  377. -- ====================
  378.  
  379. ProjectileType = "NewBullet";
  380. BeamWidth0 = 0.4;
  381. BeamWidth1 = 0.4;
  382. BeamFadeTime = nil;
  383. BulletSpeed = 4000;
  384. GravityFactor = 0;
  385. TrailLength = nil;
  386. TrailLengthFactor = 1;
  387. ShowEntireTrailUntilHit = false;
  388. CanMovePart = true;
  389. CanSpinPart = false;
  390. SpinX = 3;
  391. SpinY = 0;
  392. SpinZ = 0;
  393.  
  394. -- ====================
  395. -- CHARGED SHOT
  396. -- Make a gun charging before firing. Useful for a gun like "Railgun" or "Laser Cannon"
  397. -- ====================
  398.  
  399. ChargedShotEnabled = false;
  400. ChargingTime = 1;
  401.  
  402. -- ====================
  403. -- MINIGUN
  404. -- Make a gun delay before/after firing
  405. -- ====================
  406.  
  407. MinigunEnabled = false;
  408. DelayBeforeFiring = 1;
  409. DelayAfterFiring = 1;
  410.  
  411. -- ====================
  412. -- MISCELLANEOUS
  413. -- Etc. settings for the gun
  414. -- ====================
  415.  
  416. Knockback = 0; --Setting above 0 will enabling the gun to push enemy back.
  417. Lifesteal = 0; --In percent - Setting above 0 will allow user to steal enemy's health by dealing a damage to them.
  418.  
  419. FlamingBullet = false; --Enable the bullet to set enemy on fire. Its DPS and Duration can be edited inside "IgniteScript"
  420. IgniteChance = 100;
  421.  
  422. FreezingBullet = false; --Enable the bullet to freeze enemy. Its Duration can be edited inside "IcifyScript"
  423. IcifyChance = 100;
  424.  
  425. DualEnabled = false; --Enable the user to hold two guns instead one. In order to make this setting work, you must clone its Handle and name it to "Handle2". Enabling this setting will override Idle Animation ID.
  426. --Piercing = 0; --Setting above 0 will enabling the gun to penetrate up to XX victim(s). Cannot penetrate wall. NOTE: It doesn't work with "ExplosiveEnabled"
  427.  
  428. -- ====================
  429. -- END OF SETTING
  430. -- ====================
  431. }
  432.  
  433. return Module
Add Comment
Please, Sign In to add comment