Door lock system

In this place ► How To Do Resident Evil 7 Door Mechanics - Part 2 | #08 Unreal Engine 4 Tutorials - YouTube, between Closed and Rotate Door function, you should add test - have key or not. This should be branch. If key is true connect with Rotate Door function, if false - do nothing or Print String message “no key found”.

How to add key to player inventory is another question and explanation need tutorial, but you can start from simple inventory system from Epic https://docs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1gZalvQWYs8sc7RP_-8eSr3i/
This sample project you can install from your Learn tab in Epic Launcher.