class Main extends PluginBase implements Listener{ public function onEnable() { parent:nEnable(); $this->getServer()->getScheduler()->scheduleDelayedTask(new Task($this, $player), 40); } public function onRun($tick){ switch($tick){ case 1: $this->player->sendPopup(TextFormat::RED . "Welcome to BudinoCraft!"); case 2: $this->player->sendPopup(TextFormat::GOLD . "elcome to BudinoCraft! W"); case 3: $this->player->sendPopup(TextFormat::YELLOW . "lcome to BudinoCraft! We"); case 4: $this->player->sendPopup(TextFormat::GREEN . "come to BudinoCraft! Wel"); case 5: $this->player->sendPopup(TextFormat::BLUE . "ome to BudinoCraft! Welc"); case 6: $this->player->sendPopup(TextFormat::LIGHT_PURPLE . "me to BudinoCraft! Welco"); case 7: $this->player->sendPopup(TextFormat::RED . "e to BudinoCraft! Welcom"); case 8: $this->player->sendPopup(TextFormat::GOLD . "to BudinoCraft! Welcome"); case 9: $this->player->sendPopup(TextFormat::YELLOW . "o BudinoCraft! Welcome t"); case 10: $this->player->sendPopup(TextFormat::GREEN . " BudinoCraft! Welcome to"); case 11: $this->player->sendPopup(TextFormat::BLUE . "BudinoCraft! Welcome to "); case 12: $this->player->sendPopup(TextFormat::LIGHT_PURPLE . "udinoCraft! Welcome to B"); case 13: $this->player->sendPopup(TextFormat::RED . "dinoCraft! Welcome to Bu"); case 14: $this->player->sendPopup(TextFormat::GOLD . "inoCraft! Welcome to Bud"); case 15: $this->player->sendPopup(TextFormat::YELLOW . "noCraft! Welcome to Budi"); case 16: $this->player->sendPopup(TextFormat::GREEN . " oCraft! Welcome to Budin"); case 17: $this->player->sendPopup(TextFormat::GOLD . "Craft! Welcome to Budino"); case 18: $this->player->sendPopup(TextFormat::YELLOW . "raft! Welcome to BudinoC"); case 19: $this->player->sendPopup(TextFormat::RED . "aft! Welcome to BudinoCr"); case 20: $this->player->sendPopup(TextFormat::GOLD . "ft! Welcome to BudinoCra"); case 21: $this->player->sendPopup(TextFormat::YELLOW . "t! Welcome to BudinoCraf"); case 22: $this->player->sendPopup(TextFormat::GREEN . "! Welcome to BudinoCraft"); case 23: $this->player->sendPopup(TextFormat::BLUE . "Welcome to BudinoCraft!"); } } }
I think you can send it like after 8 ticks, so 1, 8, 16, ... Also, the 23 isn't needed, just do $tick = 1; in 22.
What's the matter PHP: <?phpnamespace ScrollerPopup\robozeri;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\utils\TextFormat;use ScrollerPopup\robozeri\Task;class Main extends PluginBase implements Listener{ public function onEnable() { parent::eek:nEnable(); $this->getServer()->getScheduler()->scheduleDelayedTask(new Task($this, $player), 40); } } other class PHP: <?php/** To change this license header, choose License Headers in Project Properties.* To change this template file, choose Tools | Templates* and open the template in the editor.*/use pocketmine\scheduler\PluginTask;class Task extends PluginTask { public function onRun($tick){ switch($tick){ case 1: $this->player->sendPopup(TextFormat::RED . "Welcome to BudinoCraft!"); case 2: $this->player->sendPopup(TextFormat::GOLD . "elcome to BudinoCraft! W"); case 3: $this->player->sendPopup(TextFormat::YELLOW . "lcome to BudinoCraft! We"); case 4: $this->player->sendPopup(TextFormat::GREEN . "come to BudinoCraft! Wel"); case 5: $this->player->sendPopup(TextFormat::BLUE . "ome to BudinoCraft! Welc"); case 6: $this->player->sendPopup(TextFormat::LIGHT_PURPLE . "me to BudinoCraft! Welco"); case 7: $this->player->sendPopup(TextFormat::RED . "e to BudinoCraft! Welcom"); case 8: $this->player->sendPopup(TextFormat::GOLD . "to BudinoCraft! Welcome"); case 9: $this->player->sendPopup(TextFormat::YELLOW . "o BudinoCraft! Welcome t"); case 10: $this->player->sendPopup(TextFormat::GREEN . " BudinoCraft! Welcome to"); case 11: $this->player->sendPopup(TextFormat::BLUE . "BudinoCraft! Welcome to "); case 12: $this->player->sendPopup(TextFormat::LIGHT_PURPLE . "udinoCraft! Welcome to B"); case 13: $this->player->sendPopup(TextFormat::RED . "dinoCraft! Welcome to Bu"); case 14: $this->player->sendPopup(TextFormat::GOLD . "inoCraft! Welcome to Bud"); case 15: $this->player->sendPopup(TextFormat::YELLOW . "noCraft! Welcome to Budi"); case 16: $this->player->sendPopup(TextFormat::GREEN . " oCraft! Welcome to Budin"); case 17: $this->player->sendPopup(TextFormat::GOLD . "Craft! Welcome to Budino"); case 18: $this->player->sendPopup(TextFormat::YELLOW . "raft! Welcome to BudinoC"); case 19: $this->player->sendPopup(TextFormat::RED . "aft! Welcome to BudinoCr"); case 20: $this->player->sendPopup(TextFormat::GOLD . "ft! Welcome to BudinoCra"); case 21: $this->player->sendPopup(TextFormat::YELLOW . "t! Welcome to BudinoCraf"); case 22: $this->player->sendPopup(TextFormat::GREEN . "! Welcome to BudinoCraft"); case 23: $this->player->sendPopup(TextFormat::BLUE . "Welcome to BudinoCraft!"); case 24: $this->player->sendPopup(TextFormat::RED . "Buy vip on new web site "); }}}
It does not do any actions. The problem is, the switch is pointless. Moreover, $tick is the server tick and is useless to you.
You should be able to change this code, instead of using $tick, use $current PHP: public function __construct(Main $plugin, $message, $duration){ parent::__construct($plugin); $this->plugin = $plugin; $this->message = $message; $this->duration = $duration; $this->current = 0; } public function onRun($tick){ $this->plugin = $this->getOwner(); if($this->current <= $this->duration){ foreach($this->plugin->getServer()->getOnlinePlayers() as $players){ $players->sendPopup($this->message); } }else{ $this->plugin->getServer()->getScheduler()->cancelTask($this->getTaskId()); } $this->current += 1; }
Use this, written by Shoghicp Code: $task = new MarqueeTask($plugin, $player, "Welcome to BudinoCraft!"); $server->getScheduler()->scheduleTask($task); However this wouldn't give exactly the results you are after, but it will do a marquee, so it would have to be adapted slightly to do what you want it to. I have forked that gist and edited it, I haven't tested it, but I think it will work. with: Code: $task = new MarqueeTask($plugin, $player, "Welcome to BudinoCraft!", null, "", true); $server->getScheduler()->scheduleTask($task);
Can you make me a plugin that does that fast scroll transitions with including text: "Welcome to Minin' Some Fire Creative Server!" three+ times ASAP? Thank you so much
lol from my skywars server heres the source: PHP: public function onEnable(){ $this->pmsg = " You are Playing on SamCraft SkyWars Beta! Tap a Sign to join a Match! "; $this->pmc = 0; $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask(array($this, "popup")),3); //Callbacktask still works lol}public function popup(){ //$tn = substr($this->pmsg,(strlen($this->pmsg)-1)); //Other way //$tc = substr($this->pmsg,0,(strlen($this->pmsg)-1)); $tn = substr($this->pmsg,1); $tc = substr($this->pmsg,1,1); $this->pmsg = $tn.$tc; foreach(Server::getInstance()->getOnlinePlayers() as $ppp){ if($ppp->getLevel() == $this->lobby){ $ppp->sendPopup(str_repeat("§4#",25) . "\n§e " . substr($this->pmsg,0,25)); } } $this->pmc++; }