Jump to content

Add item script.


Lehcar

Recommended Posts

Hi, I want to make my own script that will, quite simply, add some items to my inventory when I type it into the console. Nothing else.

 

The items I want to add are custom ones that I made myself, not ones that ship with the game.

 

However, every attempt so far has been a failure and I'm clueless as to how to write a working script. Can someone pretty please give me one that will do what I need it to do? :(

 

 

Link to comment
Share on other sites

Not sure how it works, but this mod adds to the inventory without even needing to invoke the console: Ancient Elven Boots Fix.

 

(Now what it adds is a book. When "used", the book adds the item. I believe that's how the author got around the need for the console.)

 

Hope that helps. :thumbsup:

Link to comment
Share on other sites

Hi, I want to make my own script that will, quite simply, add some items to my inventory when I type it into the console. Nothing else.

 

The items I want to add are custom ones that I made myself, not ones that ship with the game.

 

However, every attempt so far has been a failure and I'm clueless as to how to write a working script. Can someone pretty please give me one that will do what I need it to do? :(

 

This should work:

 

Create new script in your module. module and owner module should be your module name. I believe you have to set this script in module preferences after you create it.

This is what script should contain.

 

void main()

{

object oPC = GetHero(); // with this you are saying that player character will now be called oPC and that it is an object

CreateItemOnObject (R"replacethiswithnameofyouritem.uti", oPC); //here you say give this item to oPC. R stands for resource

}

 

Save script as replacethiswithsomename.nss (You will later type that name in console without .nss part)

Link to comment
Share on other sites

  • 7 years later...
  • 3 months later...
  • Recently Browsing   0 members

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