Jump to content

Getting a key though dialogue


Gam3r87

Recommended Posts

from my faction mod i want to know what you need to put to get a key though a dialogue at first i thought player.additem then the editor id of the key but its not an item so just want to know how you get the npc to give u a key thats it

Link to comment
Share on other sites

Hey Gam3r87! Here are the basic steps to make an NPC give a key.

 

1. Give your NPC an internal variable in their script ("int GaveKey").

2. Condition the dialogue topic (where the NPC will say something like "here is the key") with GetScriptVariable == 0 for the GaveKey int and GetItemCount for caps (if the player will be buying it)

3. Add an End result script to the "Here is the key" response with "Player.AddItem KeyID 1" and "Set NPCREF.GaveKey to 1". Also tick it say once.

 

That should make it so the NPC will only give the player the key once. If you are not sure how to do this, take a look at my edit of your Snow Cabin mod and you can see how the key is given to the player. Hit me up if you have any questions! :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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