PHP: $distance = $player->distance(new Vector3($x, $y, $z)); While $player is your player object and $x, $y, $z the coordinates.