# Randomize

#### DogeWorm

##### That Insomniac
So I would like to know how to randomize something to get when you click a category. Example: I click potions. The person randomly gives me Potion, Hi-Potion or Full Potion. How do I do this?

#### Shaz

##### Veteran
Control Variables - Random Number combined with Conditional Branches.

#### DogeWorm

##### That Insomniac
Does making each item have a different rate require a script? I want it to make the rarer items harder to get.

#### bgillisp

##### Global Moderators
Nope, just requires mathematics. Figure out what the percent chance you want it to be for each item, then set up the control variable based on that.

Example. Say I want a 50% chance of getting a Potion, a 30% chance of getting a Hi Potion, and a 20% chance of getting an Elixir. 50 + 30 + 20 = 100, so I set the control variable to be a random number between 1 - 100. Then, if it is <= 50, I give the party a potion, if it is between 51 and 70, I give the party a Hi Potion, and if it is > 70% I give the party an Elixir.

You'll need nested conditional branches to pull it off (the between 51 and 70 requires one for >= 51 and a second one for <= 70), but it will work.

#### DogeWorm

##### That Insomniac
Omg never thought of that! Thanks!

#### DogeWorm

##### That Insomniac
How do you make a conditional branch that is if variable is x-y, do this?

### Latest Profile Posts

I've been experimenting with improved memory management again, which allowed me to include items to increase player path length. These are both 44 grid spaces long, and stable.
I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!
Stream will be live shortly! I am going to be playing some Among Us! Feel free to drop by!
tv program always get the ratings (it's the reason why drama series has 1000+ episode),also full and nonsense of censorship (weird blur, a scene getting cut because the unconvenient viewer,but it unconvenient to me either. you never see what the original is)

i know the reason is to take cover the viewer from the negative thing,but i just laughing and mocking of them that they're always suck
Star Chart Idea - Just something I am working on.