Vending Machine

By LadylexUK

For this I used a Computer Terminal Table laid flat to a wall, and some beverage bottles. In this example all the food items are the same and give the same health additions. The bottles are chosen randomly out of the machine. When all bottles are removed the vending machine turns off.

  1. WHEN [once] DO [objset:drinks][equals][IWP:Beverage bottle][plus][IWP:Beverage bottle][plus]….etc // put all your food items in the vending machine into this object set
  2. …WHEN DO [numvar:drinks][equals][8] // number of items
  3. WHEN [has power]
  4. …WHEN [interacted] DO [it][health][incremented by][25]
  5. …/…WHEN [started to]
  6. …/…/…WHEN DO [numvar:random bottle][equals][random number][1][to][objset:drinks][count][as][integer]
  7. …/…/…/…WHEN DO [for each of][objset:drinks]
  8. …/…/…/…/…WHEN [current index][equal to][numvar: random bottle] DO [destroy][it]
  9. …/…/…/…WHEN DO [play sound][sound: avatar swoosh]
  10. …/…/…/…WHEN DO [numvar: drinks][decrement by][1]
  11. WHEN [numvar:drinks][equals][0] DO [power off]

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: