How? Example onTask(){ $color = array("§1", "§2"); array(rand? what Am I doing here?); $ft = foatingTextParticle($color, "How?"); $ft = setinvisible();? please no butthurt comments Im noob plugin developer who is trying to improve and in-learning of php.
You should learn how to do basic PHP before you try to make PocketMine plugins, otherwise you're going to hit a wall with things like this. https://www.codecademy.com/learn/php http://www.learn-php.org/ http://www.sololearn.com/Course/PHP/ etc. use Google.
Sorry? I simply made the statement that you should learn PHP before attempting to make PocketMine plugins. This is a standard response I make, so don't think that I'm somehow targeting you. Is there a reason that you are so interested in making PocketMine plugins without taking the time to properly learn PHP?
I know basic PHP I was lazy to correct it. and yes someone have already telled me how to make this and this thread is already solved so bye . LOCKED .
something like this? (meant for others) PHP: <?phpnamespace something;use pocketmine\level\particle\FloatingTextParticle;use pocketmine\plugin\Plugin;use pocketmine\scheduler\PluginTask;class FTPUpdate extends PluginTask{ public $ft = null; public function __construct(Plugin $owner) { parent::__construct($owner); } public function onRun($currentTick) { if ($this->ft instanceof FloatingTextParticle){ $this->ft->setInvisible(true); } $color_array = ["§1", "§2"]; $title = ""; $msg = "something here asfajbsfdj"; $r = mt_rand(0,count($color_array) - 1); //Make sure to define $vector3 $ft = new FloatingTextParticle($vector3, $color_array[$r].$msg, $title); foreach ($this->getOwner()->getServer()->getOnlinePlayers() as $player){ $player->getLevel()->addParticle($ft,$player); } $this->ft = ft; }}
He is right, so why that? then yours is more useless than @Extreme_Heat's. @CaptainKenji17 Please explain more, do you want a floating text that changes by time? or just a floating text? also you are not a noob, you are just a beginner.
(•_•) ( •_•)>⌐■-■ (⌐■_■) As someone who has been programming for years, it's easy to pass off the importance of actually learning a language and going straight into making things. This forums is for PocketMine specific help, not the learn-how-to-use-PHP type of help.There are many other places for that. That said, I think I've substituted the job of Google by providing the OP the links so they can actually learn PHP. It was never meant to be an insult.
never knew you can do $color_array =... btw my simle method was $color = array(..); $rand =array_rand($color); and then just add "{$color[$rand]}" on text