Check exp (killstreak)

Discussion in 'Plugin Development' started by looparound, Sep 11, 2013.

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

    looparound

    Trying to make a killstreak system where it checks ur exp and if it has a certain amount than it does blablabla. This is not working though, how is is now is so whenever u kill someone it flares the first killstreak, which is suppose to = 3 kills. If u can help thanks! :D

    if(p.getExp() <= 51){
    Bukkit.broadcastMessage(prefix + ChatColor.BLUE + p.getName() + " is on a " + ChatColor.GOLD + "3" + ChatColor.BLUE + " killstreak!");
    p.getInventory().addItem(new ItemStack(Material.POTION, 1, (short)8201));
     
  2. Offline

    xXSniperzzXx_SD

    Not sure if this is what your trying to do, but remember levels and exp are two different things and when your level goes from 1 to 2, your exp gets set back to 0, then will go back up till it gets to max of level 2, then level becomes 3 and exp goes back to 0.
     
  3. Offline

    dillyg10

    EXP is a value between 0.0 and 1.0 floating point value. I would recommend just having it based on levels, or writing a few custom listeners to listen for picking up XP, and logging that data.
     
Thread Status:
Not open for further replies.

Share This Page