Please help me :c My code not work public function KillRewards(PlayerDeathEvent $event){ $player = $event->getPlayer(); switch(mt_rand(0,3){ case 1: $drops = []; $id = mt_rand(1,280); $count = mt_rand(3, 10); $drops[] = new Item($id, 0, $count); $event->setDrops($drops); break; case 2; $drops = []; $id = mt_rand(2,288); $count = mt_rand(3, 10); $drops[] = new Item($id, 0, $count); $event->setDrops($drops); break; case 3; $drops = []; $id = mt_rand(3,360); $count = mt_rand(3, 10); $drops[] = new Item($id, 0, $count); $event->setDrops($drops); break; } }
PHP: Public Function onDeath(PlayerDeathEvent $ev){$id = 1;$count = 1;$damage = 0;switch(mt_rand(1,3)){Case 1:$ev->setDrops(array(Item::get($id,$damage,$count));BreakCase 2:$ev->setDrops(array(Item::get(2,0,2));Break;Case 3:$ev->setDrops(array(Item::get(7,7,7));Break;}} Fix Code And USE [CODE ] #CODE [ /CODE]