It's like you're asking us to make your whole game (of functionalities) with 2 lines as specifications.
You make all the loot dropped go to a chest by taking their data from the ground and push them in the chest's data.
You make separated chests by making different separated chests with different right accesses.
Can't get any more precise than that.