Checking when a player levels up

Discussion in 'Plugin Development' started by Kassestral, Jun 5, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    L33m4n123

    thats why I let the loop start from the level he is on. but ye I didn't read your post and after reading your post. However I have a question about your code
    the reason why I loop from the currentLevel on and higher is that if they get enough exp to level up 2 or 3 levels at once. Your way

    Code:
    if (level[currentLevel] <= currentExp)
    would only detect one level up even though they might get more exp and thus will be lacking behind a bit. And my method if it starts looping from currentLevel and checking if exp is higher -> continue. if exp is less -> break. That way it can be detected if he for example levels due to what ever from level 1 directly to level 5

    Edit: And also. If the level would not change it would break out of the loop right away thus not keep looping over it
     
  2. Offline

    Kassestral

    1Rogue
    I decided I will just wait till tomorrow then try again to see if i can come to grips with what I am doing here xD
     
Thread Status:
Not open for further replies.

Share This Page