Sorry for a late reply, but here’s what Ive done, the function chooses a pet based on its rarity weight. I’ve just made it more clear making an inventory gui. when you click the button to buy an egg, the function chooses a random pet and just for visuals right now i made it go into the inventory. here’s a video of that
I tried calculating the chances by doing the chance of getting a common for example divided by the number of pets inside of the rarity. 75% of a common/3 common pets results in 25% of getting a common pet? But I don’t know how to use that information in the script
Sorry for my late reply, if you already figured out your way to calculate the percentages then make a function in your module that returns the calculations.
sorry, I tried making one but I couldn’t. I made a function with a for loop that goes through the number of pets there are in total and calculates the chances of every single pet that didn’t work because it kept cloning the cells into the gui i want the percentages go into (also the percentage was the same in each one so that didn’t work) Thank you for helping though. Really appreciate it, and also my bad for the late reply