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)