Please make a backup of your project before following this guide!

Following this guide will overwrite the following blueprints, so if you have made any of your own changes in them the change will be lost.

BP_MasterLock

Find the BP_MasterLock in the content browser and right click it and select Create Child Blueprint Class and call it BP_KeyLock then open it and click the save button. Then move the BP_KeyLock blueprint to the Furniture folder.

Next go to the S_ConsumableDetails and create a new variable called Is Key and set its type to Boolean like the image below.

Then click the save button, then play in editor, this may take a while to load. Once the character loads in exit the player in editor and click the save all button in the content browser and restart the project.

Next go to the BP_GlobalInventoryManager and copy the image below.

Next go to the BP_MasterInventory and create a new function called FindKeyItem and add a new input called Key Code and set the type to name. Then add an output called Found and set it to a Boolean. Now copy the image below.

Next go to the BP_PlayerInventory and create a new function called PlayerFindKeyItem and add a new input called Key Code and set the type to name. Then add an output called Found and set it to a Boolean. Now copy the image below.

Next go to the BuildPartList and add a new row and set it like the image below. Make sure you set the Row Name (This is the thing the arrow is pointing to and make sure its exactly the same as the images below)

Item Cost will be set in a moment.

Next go to the ItemList and add a new row and set it like the image below.

Then do the same again with the item shown below. Make sure you dont miss any setting including the Is Key option.

Now go back to the BuildPartList and set the ItemCost and ItemOverrideCost to what the image below shows.

Next make the changes shown in the images below, locations at the tops of the images.

Next go to the S_OtherInvSaves and add a new variable called Code and set it to Name variable type. Like the Image below.

Then click the save button, then play in editor, this may take a while to load. Once the character loads in exit the player in editor and click the save all button in the content browser and restart the project.

Next make the changes shown in the images below, locations at the top of the screenshots.

Next go to the S_MasterItemSave and add a new variable called Code and set its type to Name. Like the image below shows.

Then click the save button, then play in editor, this may take a while to load. Once the character loads in exit the player in editor and click the save all button in the content browser and restart the project.

Then make the changes shown in the images below, location at the top of the screenshots.

Next copy the video below.

Go to BP_MasterBuildPart and create a new variable called OnlyOneOwner and set its variable type to Boolean and tick on Instance Editable and compile.

Then go to the BP_PlotPole and add the highlighted nodes shown below.

Next click the save all button in the content browser and close the project and then download and un zip the folder below.

https://www.dropbox.com/s/el9zsg3hck9zzug/KeyLock.zip?dl=0

Next copy the video below.

Next open the project and import the icon images included in the files that you download earlier then open both images and set there texture group to UI like the image below.

Then copy the video below.

If you want the player to be able to craft the lock then copy the image below to add it to the crafting list.

Info on how the key lock works below.

https://defusestudios.com/sgk-v2-key-locks/