local RunService = game:GetService("RunService") local RS = game:GetService("ReplicatedStorage") local GunController = require(RS.Modules.Client.Controllers.GunController) local hf = hookfunction local nc = newcclosure or function(f) return f end local cf = clonefunction or function(f) return f end local cfg = { infiniteAmmo = true } local function keepAmmo(weapon) if type(weapon) ~= "table" or not cfg.infiniteAmmo then return end local max = weapon.MaxMagSize or 30 weapon.AmmoType = "none" weapon.MagAmmo = max + 1 if weapon._magazines then for i = 1, #weapon._magazines do weapon._magazines[i] = max end end end if hf then local ok, FS = pcall(require, RS.Modules.Shared.FirearmState) if ok and FS.Fire then local origFire = cf(FS.Fire) hf(FS.Fire, nc(function(self, ...) if type(self) == "table" then keepAmmo(self) end local result = origFire(self, ...) if type(self) == "table" then keepAmmo(self) end return result end)) end if ok and type(FS.GetReserve) == "function" then local origReserve = cf(FS.GetReserve) hf(FS.GetReserve, nc(function(self, ...) local reserve = origReserve(self, ...) if cfg.infiniteAmmo and type(self) == "table" and reserve <= 0 then return 9999 end return reserve end)) end local okAP, AP = pcall(require, RS.Modules.Shared.AmmoPool) if okAP and type(AP.ConsumeAmmo) == "function" then local origConsume = cf(AP.ConsumeAmmo) hf(AP.ConsumeAmmo, nc(function(pool, ammoType, amount, ...) if cfg.infiniteAmmo then return amount or 1 end return origConsume(pool, ammoType, amount, ...) end)) end end keepAmmo(GunController.Weapon) RunService.PreRender:Connect(function() if cfg.infiniteAmmo and GunController.FireHeld then keepAmmo(GunController.Weapon) end end)