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

Solved Teleport player to my position

Discussion in 'Plugin Help' started by NatanM, Nov 21, 2018.

  1. NatanM

    NatanM Spider

    Messages:
    10
    How can I make that ?

    I'm tried:
    Code:
    $pos = new Vector3($x, $y, $z);
    
    Code:
    $player->teleport($pos);
    
    or
    Code:
    $player->setPosition($pos);
    
    but that is causing errors
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    $you = $player->getServer()->getPlayerExact("YourNameHere"):
    $player->teleport($you->asVector3());
     
  3. NatanM

    NatanM Spider

    Messages:
    10
    How can I make him teleport 4 blocks away from me ?
     
  4. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    PHP:
    $you $player->getServer()->getPlayerExact("YourNameHere"):
    $player->teleport($you->asVector3()->add(404)); 
     
  5. NatanM

    NatanM Spider

    Messages:
    10
    Worked ! Thanks !
     
  6. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Your welcome!
     
  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.