refilling items from a chest into a players inventory

I am making a practice world to practice pvp and I got stuck on creating a refilling function basically I have a chest setup where the player can organize and equipt the kit inside the chest it works by replacing the item inside a specific location inside the chest into the players inventory but I want to have a function that refills only certain items ignoring others please help

Continue to help post