How do I make a random item giver that has a chance to give out a random item

I’m making a Hide and Seek game with items hiders can use to get away from the seeker. I have these items in my game Heavy shard, Gimberry, Galaxy fish, and Energy bar. So how do I make a code that I press a button get a small chance to get one of these four items. Also I’m looking for better items have lower chance like energy bar has a higher chance, Heavy shard, low chance, Gimberry really low chance, Galaxy fish, low chance

2 Likes

There are like, a million randomizer guides. Search. Before. You. Post.

5 Likes

Welcome to the Forums @HideAndGoSeek ! Please, when you have time, read the forum-beginners and forum-tips.


Anyways, your problem…
This randomizer should be quite simple.
All you will need are a few devices:

  • Some Item Granters (the number of granters will vary depending on the number of items
  • A Trigger
  • A device that can trigger the randomizer, like maybe a button for your situation.

Now the rest is simple…
First, wire the button to the trigger like this:



Next, Open a block in the Trigger and set it up like this:



You can always change up the numbers in the blockcode to make your own preferred percentages.


Lastly, set up some Item Granters that grant those items corresponding to the channels:


Do this for all of the item granters:


And there you go @HideAndGoSeek , there is your randomizer! Let me know if you need any extra explanation or don’t understand something!

...

Now, this is also very true, as you should always remember to search before you ask. But since it is you first time here, we can cut you some slack :)


Now, if you problem is solved, don’t forget to mark someone solution when you are ready.
1 Like

ok chill, they are new. But this is true, search before u post

2 Likes

I didn’t mean to be rude, it’s just exasperating. (Big word :D)

3 Likes

@HideAndGoSeek, please remove the ideas tag from your post, you can edit using this button:

1 Like

I think I can help with that. I can show you a layout on how I did it.

Use this layout I made with a trigger.

Here is a more efficient way to a randomizer

Basically when it says create text with “random” that mean It’ll broadcast a with “randomX”
The X stands for the variable random which get a random number from up top, so let’s say we got 3 it would send out channel “random3”

You can put that in every item granter
Like this

Heavy chard item granter

Grant item when receiving on "random3" 

Pickaxe item granter

Grant item when receiving on "random2" 

Cash item granter

Grant item when receiving on "random1" 

And so on…

1 Like

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