Usually, all my games have XP, but I never used a levelling system as I do not know where to start entirely. For example, would I have to create table which holds all the milestones of XP that a player must reach in order to reach a certain level? Or would I have to do a series of IF statements for example:
if XP > 500 and XP < 999 then
level = 2
elseif XP > 100 and XP < 1999 then
level = 3
end
and so on...

4 comments
use a simple pattern ex; if XP.Value >= 100 * rank.Value then
so if the player's "rank" was 3, they'd need to get 300 XP to level up, since 100 * 3 = 300
What if the pattern varies with level? for example, 500xp for level 2, 1000 xp for level 2, 3000 xp for level 3 and so on
level = xp/1000