This is for an upcoming game I'm creating, I will be pasting all of this code into the game when I'm ready to use it! On it's own, it has taken me 1 hour, but the game it'll be added into, I have been working on all month! It works very well, I got mythical on my 63rd try, it really hurt just to test.
HOW TO CREATE THIS TOO There is 5 different rarities and each are subject to 100 in my project. It doesn't matter how much rarities you have, if they are evenly split, or not. You'll aways have to make the chance lower and lower each time, if you prefer more rarities and lower chances, then you can make your rarities subject to numbers bigger than 100, by making a chance variable and setting it random between 1-(your number) and then if its between two certain numbers, than it'll add that to your given list. To properly create the chances, make the number gap smaller each time. The first rarity will always be the most common and will be at least 50% . If it is 50%, Make the code block, "If (chance) is lesser than, (the number that is 1% bigger than the original chance) common is added to list" Any middle number will go "If (chance) is greater than the previous rarity's (chance) AND the (chance) is lesser than, (the number that is 1% bigger than the original chance) rare/epic/legendary is added to list" If the lowest chance is only 1% then it'll go "If (chance) equals (highest number), add Mythical to list"