Jump to content

Need Help with a simple script to add gold


Recommended Posts

I have created an item that when you pick it up it is supposed to add 50 gold to your inventory. I know how to make simple scripts for oblivion and FNV, but papyrus is giving me some issues. Here is the script I have, but it just won't compile.

 

 

==============================================

Scriptname aGenieGoldScript extends ObjectReference

 

Event OnActivate(ObjectReference akActionRef)

game.getplayer().additem(gold001,50)

endEvent

 

==============================================

 

If anyone can tell me what is wrong and help me get it working it would be much appreciated. Thanks

Link to comment
Share on other sites

Ok I added that line. The script compiled and I was able to save. But the script still isn't working in game. I pick up the object, and nothing happens. It should add 50 gold to the player. But I get nadda. I'm sure theres something stupid I'm missing.
Link to comment
Share on other sites

SOLVED!!!!!!!!!

 

Ok I got the script working. Instead of using the line you suggested "Form Property Gold001 auto" , I used "MiscObject Property Gold001 auto" then I was able to select Gold001(in the Pick Object dropdown window) in the properties section. Heres my working script:

 

 

============================================

Scriptname aGenieGoldScript extends ObjectReference

 

MiscObject Property Gold001 auto

 

Event OnActivate(ObjectReference akActionRef)

game.getplayer().additem(gold001,50)

Debug.messagebox("SKYRIMS UNIQUE TREASURES You have found a unique lamp. You rub the lamp expecting to see a genie appear, but instead you have been granted some gold coins!")

endEvent

 

 

============================================

 

Thanks tunaisafish for pointing me in the right direction to solve this issue.Cheers and Kudos

Link to comment
Share on other sites

Well, when I used "Form Property Gold001 auto" it still compiled and the script saved with no problem. A Pick Object dropdown window became available in the properties section. But all that was in the dropdown was 2 selections. CommandingActorPersistanceForm and PapyrusPersistanceForm. I'm unsure what these functions even do.
Link to comment
Share on other sites

I don't recognise those either.

 

Not accepting a Form led to a better solution in my case anyway (well more future proof) :)

It will accept a FormList, so I can add the stuff that I want the player to start with in there, and the additem syntax doesn't even change.

I only wanted an instruction book for now, but later can add things like menu_widget, poison_apple or whatever...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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