Jump to content

Recommended Posts

Posted

I'm trying to make a vending machine take all of the Sarsaparilla and Nuka-Cola from the player's inventory and put them in the vending machine, but when I press the button in game to put the items in the machine nothing happens. Been at this for hours, help me please D:

scn VendingMachineScript

Begin OnActivate

showmessage VendingMachine

End

Begin MenuMode

set button to getbuttonpressed

if button == 0
   player.RemoveAllTypedItems VendingMachineOutside 0 1 47 VendingFormList
endif

if button == 1
   VendingMachineOutside.removeitem SSBottleFull 1
   Player.additem SSBottleFull 1
endif

if button == 2
   VendingMachineOutside.removeitem NukaCola 1
   player.additem NukaCola 1
endif

end
Posted

Try using a GameMode block instead of MenuMode.

 

As soon as you press a button, the game returns to GameMode, preventing any MenuMode blocks from running.

Posted (edited)

Still no dice, but both of the vending buttons work with both menumode and gamemode. So it's the RemoveAllTypedItems line that isn't working

Edited by Seiipher
Posted

Alright I figured it out, the form list for RemoveAllTypedItems is an exemption list. So it will remove all items except the ones on the form list.

Posted

I now have it set not to remove all vanilla "aid" items so that it only removes the Sarsaparilla and Nuka-Cola from the player's inventory, is there any way I could also make it compatible with modded "aid" items? Would I have to make a separate esp for each mod?

Posted

HAHAHA! I figured out how to do it!

 

Had to set short variables for how much Soda was in the players inventory and just use removeitem and additem commands.

  • Recently Browsing   0 members

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