How to Make "Vending Machines" with Varying Costs

Vending Machines are very useful and a very common staple in Gimkit, but they have one problem: the price cannot change. This guide will fix that.

Warning
This is not an actual vending machine, but rather a button or game overlay that does this. Also, I will be discussing COMPUTER-GENERATED prices in this.

Concept

This will use an item granter to check if the player has more than the property amount of the item they need. If they do, then it will subtract that amount and broadcast on the channel that will either give them something or give an item.

Guide

So first, set a price property. Its default should be the 1st price you need. Set this to broadcast a change on game start. After this, make a button broadcast on “Buy”. Make a block in the item granter (when receiving on “Buy”) that checks if you have enough of the item by using a greater than or equal to comparison. In the case that it is true, use concatenation to broadcast on the correct channel, and THEN update the price using the algorithm you are using to generate the price. After this, make a text device. Make a block that is for receiving on the channel that the property broadcasts on. Make it set the text to the value of the property in the block.

And there it is! You now have a store with varying prices!

Difficulty
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
0 voters
4 Likes

Nice Guide! Although, when using checkers to check properties it lags and glitches…

1 Like

Also, add images next time so that new gims can understand the concept more clearly.

1 Like

No, use the blocks inside the item granters.

1 Like

Good guide, @getrithekd! Like @VALUEX said, you should probably add pictures to make it easier to understand

3 Likes

Oh ok. Sorry I was a bit confused with what to use to check.

1 Like

Ok I’ll probably add some pictures soon.

2 Likes

What algorithm are you talking about?

However you want to generate the prices by using the computer.

1 Like

Oh ok.

You can even add the vending machine sound effect by adding a vending machine that costs 0 dollars in the wire thingy.

2 Likes

Nice idea!

1 Like

@getrithekd nice pfp, you have a chess.com account?

Yeah… Thanks for that.

Same name. This was the game I played last.

who keeps flagging me?? :sob:

People flag you?!

yes! :sob:

1 Like

Same

(also @getrithekd I friended you)

1 Like

Oof. Here’s a smiley face to cheer you up :grinning:.