This has been a problem for many people including me. The local Chance doesn't make the pets under 1% hatchable. The 1 in math.random(1,TotalWeight) would need to be 0 but it won't work.
function ChoosePet(Egg) local Data = Eggs[Egg] local Pets = Data["Pets"] local TotalWeight = 0 for i,v in pairs(Pets) do TotalWeight = TotalWeight + v.Rarity end local Chance = math.random(1,TotalWeight) local Counter = 0 for i,v in pairs(Pets) do Counter = Counter+v.Rarity if Counter >= Chance then return v.Name end end end
This script is from the better pet system. However there's another pet system that has working pet chances, it basically has a math.random(1,TotalWeight) too however it also has this:
if Chance <= Counter then return i
Both of these pet systems obviously work differently. The "i" are the suffixes and I believe that this is what makes the pets under 1% hatchable. I still don't know how to make this possible in the other pet system. Any help?