C# Unity Level up system help please

so i finally was able to write out correct information however when i try to change the Exp needed when u level past 10 it doesnt actually update it?

public void RequiredXpToLvl(){

if (newPlayer.currentexp >= newPlayer.requiredexp) {

if(requiredexp < 50 || requiredexp == 1)
{
if(level <= 10 || level == 10)
{
requiredexp += 50;
}

}

if (level >= 10 || level <= 30)
{
requiredexp += 100;
}
}
}

plus if i dont have that if(requiredexp < 50 || requiredexp == 1) it wil give me a random number of exp?

It’s a little hard for me to understand what you’re doing and what you’re trying to do. Others are more willing to help if you use code tags in the future.

That said, I think you’re using “||” (or) when you mean to use “&&” (and) in your “if statements”

EDIT:
To get a random number, use System.Random.Range() or UnityEngine.Random.Range()

oright thank u but i am 100% new to unity but i know some c# and what i am trying to do is if i level past 10 the experenice i need should change to 100+ for each level however it doesnt change ?`and i tried || and && both non of them work when i press a button?.

and also if u know how i can make sure i wont get random numbers if i dont use

if(requiredexp < 50 || requiredexp == 1)

I think you have too many if checks and it’s making things over complicated. Just try this:

public void RequiredXpToLvl()
{

    // Stop the function early if you don't have enough exp
    if (newPlayer.currentexp < newPlayer.requiredexp) return;

    if (level <= 10)
    {
        // require 50 more exp if you're level 10 or less
        requiredexp += 50;
    }
    else
    {
        // add 100 more exp if you're above level 10
        requiredexp += 100;
    }

}

requiredexp should not be a random number unless you set it to one. Maybe you’re not setting it when you create it?