How to make a Randomizer

I want the player to click a button then in a 1 in 25 chance they could get 5 med-pack onc3

2 Likes

I’m not an expert, but I can say that it involves block code and some math…
So maybe this will help? I can answer any questions you have.

4 Likes

Hi here’s a guide! (@GlowingTurtle you beat me lol)

1 Like

Open up some block code, anywhere, really, and go to math, badda bang badda bo0m, generate random integer, it will be right in front of your eyes.
Sorry for this bad explanation :rofl: you’re better off reading the guides that @JaydoPotato and @GlowingTurtle linked to this post.

2 Likes

My favorite code in Gimkit =3

you could use this guide [:scroll:] The Ultimate Guide To Doors
and go to timothy section and it will show you the code to do

There’s quite alot of guides on this.

Maybe when button pressed>trigger. Make the trigger invisible. Now: Make a block code in the trigger when triggered a variable in a random number 1-25. If the number is one, broadcast message on channel “grant medpack”. Then you get 5 medpacks from an item granter.

Okay, I was dissapointed in myself for not properly helping you (guilty, even) so here’s a mini guide on how to solve your exact problem Toxic kind of beat me to it, but I’m going to have pictures so ha!
First, place a button and have it transmit on “Randomizer” when pressed.


Then, place an item granter. In the settings, set it to grant five medpacks but don’t give it a channel yet.

Then, go to the blocks tab of the item granter and click “when receiving on channel”, then enter “Randomizer”.

Then, hit enter. Paste in this block code:

Now, there’s a one in twenty-five chance that the player will get a medpack when clicking the button.
Does this help?

1 Like

Please mark a solution :white_check_mark: if these helped you

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