Go to the BP_MasterStorageBuildPart and create a new function called LockCheck.
Add a new input called Target and set its type to BP_PlayerInventory.
Add a new output called AllowOpen and set its type to Boolean.
Then copy the image below.
Next go to the BP_PlayerBuildingComponent and add the setting shown on the node below.
Next go to the BP_CodeLock and copy the video below.
Next go to the BP_KeyLock and copy the video below.
Add the highlighted nodes shown in the image below, location at the top of the image.
Next go to the BP_WoodChest and copy the video below.
NOTE – If you have any of your own added storage build parts you can do the same in there build part blueprints to be able to attach locks to them as well.
Last go to the BP_MasterStorageBuildPart and add the highlighted nodes shown below.
You can now attach code locks and key locks to wood chest build parts to stop others from opening them.