Door open on shooting 4 targets

I would like to make a door open after I shoot 4 targets.

you could make a script that handles the collision of the targets with raycasts and it has a variable that goes up every time you shoot a target and after you shoot a target it gets disabled so that you cant just shoot the same target 4 times. im not good at coding but this is the idea. then the script could also make the door swing open or go up or however you want it to open