1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Xp

Discussion in 'Development' started by LucGamesDE, Mar 24, 2017.

  1. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    How can I set the XP level of a player in the new API?
     
  2. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    PHP:
    $p->setExpLevel(number);
     
  3. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    That is not a pmmp function! There is currently no way to set a players xp using pmmp's API.

    edit:
    Actually, it's in Human.php :confused: I only looked in Player.php :facepalm:
     
    Last edited: Mar 24, 2017
  4. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    It is a valid function. (source)
     
    jasonwynn10 and EdwardHamHam like this.
  5. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    There is a function, but I'm not sure if it would work since XP itself isn't really implemented yet.
     
  6. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    @corytortoise is right. Experience has been sort of halfly implemented. I'm quite sure these functions should work.
     
  7. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    But it's in Human and not in Player.php... How can I use that?
     
  8. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    You can use it with a Player object because Player extends Human.
     
  9. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    Oh ok. An do u know something's for setXpProgress?
     
  10. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Here are all of the XP functions.
     
    Kyd likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.