Ok, so far I found scripts for what I want to do with a few things, but there is one thing I don't have a script for. I've already tried a few times to get this to work but was frustrated by failure and scrapped it to keep things simple. But since I started Dichotomy (which might be getting back burner-ed sadly) I wanted to do this and couldn't figure out how to do it.

What I'm trying to do is create an item that unlocks specific chests, basically a treasure chest key. At the same time it was meant to work only on specific chests. The original idea was Overworld and Overworld cavern chests would be opened by the keys, leaving treasure chests in dungeons to be opened by level keys. If the idea works I could have the same kind of Overworld chests show up randomly in dungeons as well only open-able by chest keys, with other dungeon chests open-able by the finite number of level keys available in that level.

Also there would be a lot of these treasure chests, and the keys would be rare drops from certain enemies or sold by merchants.

So, scripting guru's... how is this done? I wouldn't mind someone doing the scripting for me, but I would still want to know how it works so I could utilize that knowledge in future projects or just to flesh out older ones and finally release them.