>>37141963Yeah, it's based on the total exp of your pokemon.
Here's a chart. Just look at the last 2 digits of a pokemon's total exp. From there go to the route next to your home town and fight ratatta or pidgey for 16 exp and 15 exp each until you get to your desired exp for the nature you want.
If you're going for a weird number, you can always put the pokemon into the day care, and whenever you take it out, it will have the lowest possible exp for the level it's at, essentially giving you a new starting point (closer to the total exp you want) or resetting your mistakes.
What I did though, was catch about 5 ditto in Crystal, transfer all up to Sun, and now have a batch of perfect IV's ready to be transferred down via destiny knot. Just breed one of the ditto with a VC pokemon, and you can have 5 perfect IV's within an hour.