Jump to content

Making a vending machine, need a little help.


C6Aviation

Recommended Posts

I'm trying to make a terminal-based vending machine to buy rare weapons, ammo, armor, and misc items(Right now, just hard to find ones in Fallout 3 and 20th CW, but possibly from other mods as well). What I've already gotten it to do is vend a weapon and subtract caps. Child's play, need two console commands.

 

Thing is, I want it to check the PC's caps and deny a vend if the caps are lower than the price of the item the PC wants to purchase. As it is, I can vend all the guns and ammo I want, it will simply drop my caps deeper into the red.

 

 

What command would I put into the terminal, instead of "player.additem 0000000A -<price>", to make it do this?

Link to comment
Share on other sites

Conditionalize your script.

 

For instance:

 

If player.GetItemCount Caps001 >= (price amount)

player.additem 0000000A 1

player.removeitem Caps001 (price amount)

else

showMessage InsufficientFunds

endif

 

You would have to create the message, and you don't really need it, but it would let the player know why the transaction didn't work.

Link to comment
Share on other sites

Ahh, yes. Works perfectly. :)

 

 

Now, to make some denied messages....whoo. Thanks.

 

Edit: :) Yay. Now, to expand it(Right now it sells two types of CALIBR ammo and three 20th cent guns) and mount it on it's own terminal.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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