So as the title implies I want to create a system in which I have a score that also happens to be my lock pick count. The keys are used to open random doors in the level which can either lead you to a room (small box on the level) with more of those lockpicks that my character can pick them up or just use them to open the other doors in the level in order to move on to the next one. So here are basically that I want to do in a list:
1. Have a score system that is linked to my lockpick count.
2. The score/lockpick count to get reduced every time I open a door.
3. To have doors that are opened by those lockpicks when ever the a binding key is used (so press 'e' to open the door, else the door wont open)
I know I am asking a lot, but I really have no idea how to make such a system successful due to my lack of experience with programming. I understand how most code works but I would massively appreciate if I get a good explanation on how and why does the code works.
Thank you for your time, and thank you if you even bother helping me.

