How to make a vending machine spit out a random item

How do I make a vending machine spit out a random item within a certain set of items. (Such as a random fish for fishing)

You can do an item granter! But no vending machine, sorry.

You can make an item granter give you a random item?

I think I remember that.
I think…

Okay, thanks man. I’ll try it and see.

I’ll post on here if it works.

Nope, there is none.
Sorry.

Oh, okay. That’s alright. Thanks for replying.

I’m making a fishing system too! Here’s what I did.

so first use a button for the fishing interactions. Connect that to a trigger. Then, add a block that triggers when the trigger triggers.

the block should have this (It should be simple enough to actually read so you can edit it however you want) (don’t mind the extra greyfish1 there. Also the numbers after the fish names are for me to remember the order.) (Remove the addition of the rodlevel if you don’t want to add rod levels) (remember to add those properties!)

image

After this, add all 10 (or less) fish item granters and make sure to give the player the fish when broadcasted on their corresponding channel.

For the selling part, I’d assume vending machines work but I have yet to get to that part. I’ll update when I actually figure it out! (I’m sure there’s also tutorials online)

Credit:ArcherThesu

To do this you will need some knowledge on block code so follow these steps carefully:

  1. Add your prop for the vending machine and below it add a button

  2. Place a trigger next to the button and wire them together (make sure that the trigger can’t be stepped on)

  3. Create a new block for the trigger and make this code:

  4. Add however many item granters you want and make them give the player the item when the receve one of the messages from the channels listed in the code above.

The final product should look something like this:

2 Likes

set it onto random

Where did you use block code? Is that Creative or another Gimkit website?

Some devices use code blocks such as triggers, if a device does use code blocks you can select it here:
Screenshot 2023-05-30 3.04.05 PM

Ok, thank you. I’ll try that.

das alot of blocks. /:

Dang guys, this stuff is awesome. Thanks!

wait i dont see it (extra words here)

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.