Are you talking about items that do that inherently like orbs (they do not stack)? If you are not, you would need to create a system which does what you are describing, which would not be just a few simple lines of code. I would recommend you explain what you want more in-depth.