I got a bit confused by the structure of how we level up. It felt as though it worked backwards, for me. And starting at 1 threw me off somewhat as well. So I monkeyed around with it a bit this morning, trying to build a system that worked off the opposite comparator. That is, instead of XPtoLevel > current XP, I tried to build a system that levelled up when currentXP > XPtoLevel.
i couldn’t quite make it work, though. Partly because of how GetStat returns values based on [level -1], to account for our starting level being 1. So, trying to something like returning startingLevel + level, or level ++ just doesn’t quite work.
So in the end, Sam’s method makes sense. A bit of a brain melter but fair enough!