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

Help pls

Discussion in 'Facepalm' started by WreckagePE / ZAYD, Feb 24, 2017.

  1. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    Will the //put armor on player bit work? IM SO NOOBY. I DONT EVEN KNOW PHP....
     

    Attached Files:

  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Well, one error i can see is that you used player->getInventory() instead of $player->getInventory()
    Also:
    WTF
    just replace all those spam lines with one line where the 1 at the end is the item count
     
    Muqsit likes this.
  3. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    Can you write the code? I don't really know what you mean, but thanks for feedback :D
     
  4. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    Plugin doesn't put armor on. Here is the error
     

    Attached Files:

  5. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    :facepalm:
     
    Muqsit and HimbeersaftLP like this.
  6. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    Help me instead of FACEPSLMIMG XDD
     
    Sandertv likes this.
  7. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    PHP:
    $enchantment Enchantment::getEnchantment(10);
    $enchantment->setLevel(1);
    $helmet Item::get(31001);
    $chestplate Item::get(31101);
    $leggings Item::get(31201);
    $boots Item::get(31301);
    $inv $player->getInventory();
    $helmet->addEnchantment($enchantment);
    $chestplate->addEnchantment($enchantment);
    $leggings->addEnchantment($enchantment);
    $boots->addEnchantment($enchantment);
    $inv->addItem($helmet);
    $inv->addItem($chestplate);
    $inv->addItem($leggings);
    $inv->addItem($boots);
            
    what is wrong here? Please help. It's urgent...
     
  8. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    add to uses:
    use pocketmine\item\Item;
    use pocketmine\item\enchantment\Enchantment;
    use pocketmine\item\enchantment\EnchantmentList;
    use pocketmine\item\enchantment\EnchantmentEntry;
     
    WreckagePE / ZAYD likes this.
  9. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    In all files? Or just this one?
     
  10. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    only this
     
    WreckagePE / ZAYD likes this.
  11. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    Thanks for your help daniel
     
  12. DanielYTK

    DanielYTK Zombie

    Messages:
    227
  13. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    :/ now it just simply isn't loading armor on the player...
     
  14. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    I already had use pocketmine/item/item so I removed one of them as it was causing a crash. No error in console now, just doesn't load their armor onto the player
     
  15. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    The armor should be sent to the Player's inventory. Are you trying to make it equip the armor automatically?
     
    WreckagePE / ZAYD likes this.
  16. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    Yh, so their wearing the armor :).
     
  17. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
  18. kaliiks

    kaliiks Zombie

    Messages:
    250
    $p->setBoots() $p->setHelmet() etc.
     
  19. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    No Learn API ....

    It's $p->getInventory()->setBoots($item);
     
    Muqsit likes this.
  20. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    since you already get it, then there no need to be exact we just need to be able to understand
    this is not a forum for code copiers so we please dont be too bothered
     
  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.