Ask coding questions

← Back to all posts
Another C++ function error :/
LoveFromSkyy

I'm trying to make XP go to 0 after the player levels up but I don't know how to do that.

Here is what I have:

Voters
LoveFromSkyy
Comments
hotnewtop
Coder100

why not send repl

LoveFromSkyy

Because the repl includes 400+ lines of code which would make the question harder to read.
@Coder100

Coder100

no it won't if you attach the repl we will be able to actually see all your code which will be beneficial @LoveFromSkyy

LoveFromSkyy

Okay, give me a sec.
@Coder100

Coder100
Coder100

wait could you invite me and I can add the level up for you? @LoveFromSkyy

LoveFromSkyy

sure
give me a second
@Coder100

Baconman321

Maybe store the last level that the player achieved and check if that is less than the current level. If so, then clear the XP.

InvisibleOne

You should just XP = 0;

LoveFromSkyy