So I was making this scoreboard for this plugin but when scoreboards load it gives me this Error: Undefined property : Murder\MM\Main::$score This is the php where the crash occur Code: if(strpos($pla->getNameTag(), "§b") !== false) { } } foreach($playersArena as $pla) { if(strpos($pla->getNameTag(), "§3") !== false) { $api = $this->plugin->score; $api->new($pla, $pla->getName(), TE::BOLD.TE::YELLOW."MURDER MYSTERY"); $i = 0; $lines = [ TE::WHITE." ", TE::WHITE."Murders: ".TE::GREEN.$ase, TE::WHITE."Detectives: ".TE::GREEN.$det, TE::WHITE."Innocents: ".TE::GREEN.$ino, TE::WHITE." ", TE::WHITE."Map: ".TE::GREEN.$level, TE::WHITE." ", TE::WHITE."Time: ".TE::GREEN.$time, TE::WHITE." ", TE::WHITE."wcserver.goandplay.fun ", ]; foreach($lines as $line){ if($i < 15){ $i++; $api->setLine($pla, $i, $line); } } // $pla->sendTip(TE::RED."Bestia:" . $bestia .TE::AQUA. " Runner:" . $corredor.TE::YELLOW." Dist.Bestia:".TE::LIGHT_PURPLE.$dist.TE::YELLOW." Tiempo: ".TE::GREEN.$time. TE::RESET); } else { $api = $this->plugin->score; $api->new($pla, $pla->getName(), TE::BOLD.TE::YELLOW."MURDER MYSTERY"); $i = 0; $lines = [ TE::WHITE." ", TE::WHITE."Murders: ".TE::GREEN.$ase, TE::WHITE."Detectives: ".TE::GREEN.$det, TE::WHITE."Innocents: ".TE::GREEN.$ino, TE::WHITE." ", TE::WHITE."Map: ".TE::GREEN.$level, TE::WHITE." ", TE::WHITE."Time: ".TE::GREEN.$time, TE::WHITE." ", TE::WHITE."wcserver.goandplay.fun ", ]; foreach($lines as $line){ if($i < 15){ $i++; $api->setLine($pla, $i, $line); } } And my other question is one hit swords and one hit bows. What code can I use to do that. PHP: foreach($playersArena as $pl) { if(strpos($pl->getNameTag(), "§b") !== false) { $item = Item::get(Item::DIAMOND_SWORD, 0, 1); $item = Item::get(Item::DIAMOND_SWORD, 0, 1); $pl->setNameTag("§b"); $pl->getInventory()->setItem(1, $item); $pl->getInventory()->setItem(0, Item::get(Item::BREAD, 0, 1)); $pl->getInventory()->setItem(2, Item::get(Item::CLOCK, 0, 1)); $pl->addTitle("§cYOU ARE THE MURDERER"); } } } if($timeToStart<=0) { foreach($playersArena as $pl) { if(strpos($pl->getNameTag(), "§3") !== false) { $item = Item::get(Item::BOW, 0, 1); $pl->getInventory()->setItem(1, $item); $pl->setNameTag("§3"); $pl->getInventory()->setItem(0, Item::get(Item::ARROW, 0, 64)); $pl->addTitle("§bYOU ARE THE DECETIVE"); } } }
For the second question: You can either add sharpness 20 to a sword via(https://poggit.pmmp.io/p/MaxEnchants) or take a look at this forum to set the damage of a sword: https://forums.pmmp.io/threads/how-can-change-a-weapons-damage.4705/ As for bows im not sure you can edit the power.
What code can I use to set the sharpness of the plugin. For example how can I set it PHP: foreach($playersArena as $pl) { if(strpos($pl->getNameTag(), "§b") !== false) { $item = Item::get(Item::DIAMOND_SWORD, 0, 1); $item = Item::get(Item::DIAMOND_SWORD, 0, 1); $pl->setNameTag("§b"); $pl->getInventory()->setItem(1, $item); $pl->getInventory()->setItem(0, Item::get(Item::BREAD, 0, 1)); $pl->getInventory()->setItem(2, Item::get(Item::CLOCK, 0, 1)); $pl->addTitle("§cYOU ARE THE MURDERER"); } } } if($timeToStart<=0) { foreach($playersArena as $pl) { if(strpos($pl->getNameTag(), "§3") !== false) { $item = Item::get(Item::BOW, 0, 1); $pl->getInventory()->setItem(1, $item); $pl->setNameTag("§3"); $pl->getInventory()->setItem(0, Item::get(Item::ARROW, 0, 64)); $pl->addTitle("§bYOU ARE THE DECETIVE"); } } }