Advertisement
C-H-4-0-S

Enable all

Sep 7th, 2024 (edited)
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. local weaponSystem = require(game:service'ReplicatedStorage'.WeaponsSystem.Libraries.BaseWeapon)
  2. local client = game:GetService('Players').LocalPlayer
  3.  
  4. local oldFire = weaponSystem.fire
  5. local oldGetConfigValue = weaponSystem.getConfigValue
  6. local oldUseAmmo = weaponSystem.useAmmo
  7. local oldGetAmmo = weaponSystem.getAmmoInWeapon
  8.  
  9. -- Silent Aim
  10. local function getClosestPlayer()
  11. local final = nil
  12. local maxRange = math.huge
  13.  
  14. for i, player in next, game:GetService('Players'):GetPlayers() do
  15. if player == client then continue end
  16. if (not player.Character) then continue end
  17.  
  18. local humanoid = player.Character:FindFirstChild('Humanoid')
  19. local head = player.Character:FindFirstChild('Head')
  20.  
  21. if (not head) or (not humanoid) then continue end
  22. if (humanoid.Health <= 0) then continue end
  23.  
  24. local vector, visible = workspace.CurrentCamera:WorldToViewportPoint(head.Position)
  25. if (not visible) then continue end
  26.  
  27. local cursorPosition = game:GetService('UserInputService'):GetMouseLocation()
  28. local screenPosition = Vector2.new(vector.X, vector.Y)
  29.  
  30. local difference = math.floor((screenPosition - cursorPosition).magnitude)
  31. if (difference < maxRange) then
  32. maxRange = difference
  33. final = head
  34. end
  35. end
  36. return final
  37. end
  38.  
  39. weaponSystem.fire = function(self, ...)
  40. local arguments = {...}
  41.  
  42. if _G.silentAim then
  43. local t = getClosestPlayer()
  44. if t then
  45. arguments[2] = (t.Position - arguments[1]).unit
  46. arguments[3] = 1
  47. end
  48. end
  49.  
  50. return oldFire(self, unpack(arguments))
  51. end
  52.  
  53. -- Infinite Ammo
  54. weaponSystem.getAmmoInWeapon = function(self, ...)
  55. if _G.infiniteAmmo then
  56. return 9e9 -- Infinite ammo
  57. end
  58. return oldGetAmmo(self, ...)
  59. end
  60.  
  61. -- Use Ammo with Infinite Ammo Check
  62. weaponSystem.useAmmo = function(self, ...)
  63. if _G.infiniteAmmo then
  64. if (self.ammoInWeaponValue) then
  65. return 1 -- Do not use ammo
  66. end
  67. end
  68. return oldUseAmmo(self, ...)
  69. end
  70.  
  71. -- No Recoil, No Spread, Fast Fire, Automatic Guns
  72. weaponSystem.getConfigValue = function(self, ...)
  73. local arguments = {...}
  74.  
  75. if _G.fastFire and arguments[1] == 'ShotCooldown' then
  76. return 0.01 -- Fast fire rate
  77. elseif _G.autoGuns and arguments[1] == 'FireMode' then
  78. return 'Automatic' -- Automatic fire mode
  79. elseif _G.noRecoil and (arguments[1] == 'RecoilMin' or arguments[1] == 'RecoilMax') then
  80. return 0 -- No recoil
  81. elseif _G.noSpread and (arguments[1] == 'MinSpread' or arguments[1] == 'MaxSpread') then
  82. return 0 -- No spread
  83. end
  84.  
  85. return oldGetConfigValue(self, ...)
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement