Jump to content

Scripting Help


ChrissyMcp

Recommended Posts

Okay I understand a bit of scripting with the Geck, as Ive created one the continue after ending mods. But all that aside I'm trying to figure out how to add an item to the player when he talks to someone this item will cost a certain amount of caps, so I need a script for adding and removing items upon dialouge and if the player doesn't have x amount of caps the player doesn't get the item ??

 

Any help would be appreciated .

 

chrissy_M_

Link to comment
Share on other sites

I sincerely hope you are only a newbie which did not learned yet to avoid calling yourself noob, even a half-noob is worthless to try helping :)

 

If for some reason you don't want to make that NPC a merchant, the process to add (and remove) money is the same as common items.

 

So your script should first verify if the player has the correct amount of money

 

.
.
Set iPlayerActualMoney to Player.GetItemCount caps001
If (iPlayerActualMoney >= theitemcost)
  Player.RemoveItem caps001 theitemcost
  Player.additem YourItemBaseID 1
  Set iPlayerActualMoney to iPlayerActualMoney - theitemcost
  ; process whatever else you need here
Else
  ; Process the failing transaction as desired 
Endif
.
.
;----------------------------------------------------------------------------------------------------------------------------
; If you don't need the actual amount of player's money ahead, the script chunk can be simplified to

If (Player.GetItemCount caps001 >= theitemcost)
  Player.RemoveItem caps001 theitemcost
   Player.additem YourItemBaseID 1
  ; process whatever else you need here
Else
  ; Process the failing transaction as desired 
Endif  
.
.

Edited by nosisab
Link to comment
Share on other sites

  • Recently Browsing   0 members

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