AHH another RPG problem

Hey again
I’m trying to get my character to level up, but no luck cause what i want is
if the xp is 100% it increases the variable level or whatever to 2 or 3 and then the xp bar starts at 0% again and the whole cycle begins again
how could I accomplish this?

Cheer Jesse