You can safe all players in an array an use this code: PHP: $input = array("Player1", "Player2", "Player3", "Player4");$rand_keys = array_rand($input, 2);$end = $input[$rand_keys[0]]; $end is the output
It would be simpler to use a config. Because what I'm doing is when a player types in chat it will add their name to the config, then when a command is executed it will choose a player that typed the message
I think an array would be much simpler than adding a player to a config each time. Just add their name to an array when using whatever command, and then use $this->exampleArray[array_rand($this->exampleArray, 1) to get the name.
You made the output of array_rand an array, that and I was replying to his post saying that using configs would be simpler. This post.
PHP: $players = $config->get("Players");if(is_array($players)){ $player = $players[array_rand($players)];}