Jump to content

Recommended Posts

Posted

I once made a mod in FO3 that had a terminal that you could buy things from with sufficient amount of caps, ranging from pistols to missile launchers, but i cant get to make it work in FNV.

 

my original script was:

 

Player.Removeitem caps001 100

Player.Additem (Weapon Name) 1

end.

 

and i modified it to:

 

if Player.Getitemcount Caps001 = 100

Player.Removeitem caps001 100

Player.Additem (Weapon Name) 1

endif

 

because it bought items even if you had insufficient caps.

 

but now it doesnt work. can anyone help?

Posted

if Player.Getitemcount Caps001 == 100
   Player.Removeitem caps001 100
   Player.Additem (Weapon Name) 1
endif

There's a difference between assignment '=' and comparison '==' operators. You need to use '==' in comparison operations.

Posted
Using greater than or equal to ">=" would be a better option, as using an equality test would only allow you to purchase the piece when the PC has exactly 100 caps in their inventory, as opposed to being able to buy when they have at least 100.
Posted
Should've read the entire thing. Derp. Skevitj is right. Functionally you're going to want to use a >= or you'll only ever be able to use it when you have precisely 100 caps.
  • Recently Browsing   0 members

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