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

help please T.T

Discussion in 'Plugin Help' started by princeace, May 9, 2020.

  1. princeace

    princeace Slime

    Messages:
    78
    GitHub:
    PrincessSeah
    how to target player like this

    /set <playername> life 20

    like that?

    i only ask the <playername> i dont know what is that called but i want to target player to give or set what i want! what code for that?
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    PHP:
    $playerName $args[0];
    $player $this->getServer()->getPlayer($playerName);
    if (
    $player !== null) {
      
    $player->setHealth((int) $args[2]);
    } else {
      
    $sender->sendMessage("Player not found");
    }
     
    Primus 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.