Hello everyone, this is my third post

As the title says, I’m currently stuck with the leveling code

I’m creating a level system in excel like this

```
Level Exp Needed Exp Range Total Exp
1 0 0 0
2 1 1 1
3 2 1 3
4 3 1 6
5 4 1 10
```

I’m making 200 level with exp range within each level

But as I’m writing the code, it just doesn’t connect (I’m still learning here, sorry )

I tried 2 types

the first is looping with not leveling up and the other does not update the exp needed

My code looks like this:

1st code:

```
startup.txt
*create level 1
*create exp 0
*create exprange 1
*create expneed
*create totalexp 0
*create ammount 0
*create sp 0
readexp.txt
*comment here is the second choice of leveling code
*set totalexp +exp
*if ((level > 0) and (level < 10))
*set exprange 1
*gosub readexp
*return
*if ((level > 10) and (level < 20))
*set exprange 2
*gosub readexp
*label readexp
*set expneed (exp + exprange)
*if (exp >= expneed)
*set exp -expneed
*gosub pluslevel
*return
*else
*return
*comment here is the +1 level code
*label pluslevel
*set level +1
*set ammount +5
*set sp +5
*return
```

The first code just looping in plus the exp but not leveling up, so if the exp +1 the expneeded becomes 2 and if exp +1 again (makes the exp 2) then the expneeded also +1 which becomes 3 and so the level does not increase

2nd code:

```
startup.txt
*create level 1
*create exp 0
*create exprange 1
*create c_expneed 0
*create n_expneed 0
*create totalexp 0
*create ammount 0
*create sp 0
readexp.txt
*comment here is the second choice of leveling code
*set totalexp +exp
*if ((level > 0) and (level < 10))
*set exprange 1
*gosub readexp
*return
*if ((level > 10) and (level < 20))
*set exprange 2
*gosub readexp
*label readexp
*set n_expneed (c_expneed + exprange)
*if (exp >= n_expneed)
*set exp -n_expneed
*gosub pluslevel
*return
*else
*return
*comment here is the +1 level code
*label pluslevel
*set level +1
*set ammount +5
*set sp +5
*return
```

For the second, the level does increase but the exp needed stays in 1 and not increasing further

Please help me and THANKS in advance