So I used the API from a plugin and made an addon for ScoreHud, and well I'll just show you what happens when someone who is rank Z joins the server and the Scoreboard updates: Code: [205] foreach($this->prestiges as $index => $prestige){ [206] if($prestige["tag"] === $name) return $prestige["money"]; [207] } [208] return 0; [209] } [210] [211] public function calculateMoney(Player $player) : int{ [212] if($this->getNextRank($player) === ""){ [213] if(isset($this->players[$player->getLowerCaseName()]["prestige"])){ [214] return $this->getNextPrestige($player) !== "" ? $this->prestiges[$this->getNextPrestige($player)]["money"] : 0; [215] } [216] } [217] return $this->ranks[$this->getNextRank($player)]; [218] } [219] [220] public function removeAllPermissions(string $player) : void{ [221] foreach($this->ranks as $rank => $price){ [222] if($rank !== $this->getDefaultRank()) $this->getPurePerms()->getUserDataMgr()->unsetPermission($this->getPurePerms()->getPlayer($player), strtolower(str_replace("{rank}", $rank, $this->getConfig()->get("permission")))); [223] } [224] } Does anyone know how this would be fixable?
There's like 10 thousand functions used in those two functions. Mind sending the whole code and the error?