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

How can i tp to others world

Discussion in 'Plugin Help' started by MCForever5, Apr 28, 2020.

  1. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    RAEADME!!!

    Hi there,i make a UI with FormAPI,and its about WorldUI.when player type word in input.And player click submit after type.It will automatic create a world with the name player type and tp player to that world.But.I dont know how to let people tp to that world.

    Please help me,thank you :)

    README!!!
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Where exactly are you stuck?
     
  3. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    Like i want to let people tp to otheres world by using $level->??? or $player->??? such Thing i dont know how to write it.
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    PHP:
    $levelName "blah";
    if (
    $this->getServer()->getLevelByName($levelName) === null) {
      
    $this->getServer()->loadLevel($levelName);
    }
    $level $this->getServer()->getLevelByName($levelName);
    $x 0;
    $y 0;
    $z 0;
    $player->teleport(new Position($x$y$z$level));
     
  5. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    Ohhh,thx dude.I have last problem.Like example of this(below)
    PHP:
    $player->sendMessage("§l§a» §rEntering World§b " $data[1] . "§r...");
                
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "mw create " $data[1] . " 0 FLAT" );
                
    $this->getServer()->loadLevel($data[1]);
                
    $player->teleport(Server::getInstance()->getLevelbyName($data[1])->getSafeSpawn());
    Can i make a delay between the $this->getServer()->loadLevel($data[1]); and $player->teleport(Server::getInstance()->getLevelbyName($data[1])->getSafeSpawn());?
     
  6. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Why?
     
  7. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    Cause It will make my server crash,if i dont make a time delay on them.Please just tell me how.Thank you;)
     
  8. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Crash with which error?
     
  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.