can I get a example of xyz from When your inside x: 123 y: 124 z: 125 to x: 234 y: 245 z: 256 Send message Hello When your outside Don’t send message Please do it I want see I am confuse on it
https://forums.pmmp.io/threads/best-way-to-get-a-player-in-a-defined-region.433/ or a simple way you can get by using PlayerMoveEvent like this: PHP: public function onMove(\pocketmine\event\player\PlayerMoveEvent $event){ $player = $event->getPlayer(); $playerX = $player->getX(); $playerY = $player->getY(); $playerZ = $player->getZ(); if($playerX > 123 and $playerX < 234 and $playerY > 124 and $playerY < 245 and $playerZ > 125 and $playerZ < 256){ $player->sendMessage("Hello world."); } }
Yeah but it has a little problem, when you do that the message sends every time to the player when they walks into the area, if you want to send only one time you may use arrays for that.