So I have a skill system with levels, the way it works is they start at level 1, then they can gain progress.

Each level has their own progress limits, which is calculated by [lua]level*72[/lua]. So at level 1, they need to get 72 progress points to get to level 2, and then once at level 2, the progress resets to zero, and they need to get 158 progress points to get to level 3, and so on.

Now, the problem is, lets say I award them more progress points than the levels limit, so lets say I give them 158 progress points at level 1. First I calculate the difference, [lua]CurrentProgress + AddedProgress - max[/lua]. the value max is the max amount of points the current level can hold before going to a next level.

Now, here is the problem, if I give them 158 progress points at level one, it will only level them to 2, obviously. How can I figure out how many levels to give them based on the amount of progress i give them. This is really confusing to explain for me so ask questions if you’re still confused.