Solved How to run this on xp level up? In 5's

Discussion in 'Plugin Development' started by mrsamcraft, Jan 7, 2014.

Thread Status:
Not open for further replies.
  1. Hello,

    So Im wanting to set my code to say messages and set off a firework on XP level up, but only to work when the xp on set numbers? For example 5,10,15,20,25,30 etc..

    At the moment I've got it working on every XP change event. The question is, how can I set it to only run on set levels? (5,10,15,20,25,30 etc..)

    MY CODE SO FAR.
    REMOVED FIXED!

    The Fix!
    Code:java
    1.  
    2. int level = event.getNewLevel();
    3.  
    4. if (level % 5 == 0)
    5.  


    Thanks,
    ~ Sam
     
  2. Offline

    L33m4n123

    check

    • if new level > old level
    • new level mod 5 = 0
    • do your stuff
     
  3. Sorry im still learning as I code, how would I get it to check the xp level number?

    EDIT!: FIXED!

    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page