The Code public function TopPoint($p){ $player = $p->getPlayer(); $top = 0; $point = $this->p->getAll(); arsort($point); $sd = "§e========§6[§aPoint§eTop§6]§e========"; foreach($point as $k=>$v){ $top++; if($top<=5){ $x = $this->player->getLevel->getX("262.1587"); $y = $this->player->getLevel->getY("69.963"); $z = $this->player->getLevel->getZ("257.1069"); $p = new FloatingTextParticle(new Vector3($x, $y + 1, $z), $sd, $k, $v); $player->getLevel()->addParticle($p); } } } Have any wrong ?
If you have any errors to show, then also provide that or, if not, please state that there weren't any error messages so we can skip that step. Also, please show full code so we can have the full context (or at least all the necessary bits, if its a private plugin). Is that defined anywhere? If that is a player object, though, I don't see why you can't just use $player variable which you're already passing to the function... You can add a typehint to the function to make sure that $p is actually a player object by doing: PHP: use pocketmine\Player;public function TopPoint(Player $p) { [...]}