Jump to content

Script to give a key when a note is opened


Highlord90

Recommended Posts

Trying to fix my scripting errors with the script.rar extract destroyed my installation so im gnna reinstall, restart my mod and just make it as I described above because it just isn't worth losing my saves over for some fancy scripting on a broken software

Link to comment
Share on other sites

If you've never scripted before, it can sometimes help to just successfully compile a script and have it work in-game. So, I recommend following a beginner tutorial from Bethesda: http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Hello_World

 

When I first started with scripts, it mentally helped me when I followed this tutorial and got it work successfully.

Link to comment
Share on other sites

If you are using a quest to track the status of these house purchases you can utilize the following with minimal script learning on your part...

 

Apply stock script DefaultOnReadSetQuestStage to the note in question.

Assign the quest and the stage you want set to the properties.

Then on the stage in question on the quest in question perform the following (See here for more details):

In the script fragment box, put in a comment line

;add key on stage set

Compile this, because the script must be created before you can proceed

To ensure everything is correct, exit the quest record and reopen it

Click on the properties button and add a new Key property.

Assign the key you want to use to this new key property.

Then in the script fragment box add

Game.GetPlayer().AddItem(YourKey,1)

Replace "YourKey" with whatever variable name you used when setting up the property.

After you are done, test it out in game. Be sure tho to test it out on either a new game or a save that has never seen any aspect of your mod as sometimes the game can get fickle when trying to add things to already loaded assets.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...