From 49697b2a500d45623053f24437c0d8c75327ee77 Mon Sep 17 00:00:00 2001 From: edshot99 Date: Tue, 14 Jan 2025 10:20:31 -0600 Subject: [PATCH] fix arccw gun not having ammo when using custom rounds --- .../lua/autorun/server/ammo_clip_on_kill.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ammo_clip_on_kill/lua/autorun/server/ammo_clip_on_kill.lua b/ammo_clip_on_kill/lua/autorun/server/ammo_clip_on_kill.lua index 25c56b7..dc2c827 100644 --- a/ammo_clip_on_kill/lua/autorun/server/ammo_clip_on_kill.lua +++ b/ammo_clip_on_kill/lua/autorun/server/ammo_clip_on_kill.lua @@ -22,3 +22,15 @@ hook.Add("OnNPCKilled", "edshot_AmmoRestoredOnNPCKill", function(npc, attacker, end end end) + +hook.Add("WeaponEquip", "edshot_AmmoRestoredOnEquip", function(weapon, owner) + if owner:IsValid() and !owner:IsNextBot() and !owner:IsNPC() and owner:IsPlayer() then + local weps = attacker:GetWeapons() + + for _, wep in ipairs(weps) do + if IsValid(wep) then + wep:SetClip1( wep:GetMaxClip1() ) + end + end + end +end)