Save it when plugin disables, and load it when plugin enables. PHP: public function onEnable(){ if(is_file($arraySl = $this->getDataFolder() . "array.sl")){ $this->array = unserialize(file_get_contents($arraySl)); }}public function onDisable(){ file_put_contents($this->getDataFolder() . "array.sl", serialize($this->array));} Remember not to store objects like Player or Level.
It is perfectly ok to use serialize()/unserialize() as an alternative of yaml_emit()/yaml_parse() as long as you don't try to store any objects.
ok, im not sure how to use serialize()/unserialize() or yaml_emit()/yaml_parse() to keep the array from being wiped on restart. can i have an example of how to do it?
serialize()/yaml_emit() produces a string. Use file_put_contents() to write it to a file, e.g. file_put_contents($this->getDataFolder() . "data.yml", yaml_emit($this->array));. Use file_get_contents() to read a file, and turn it into an array with unserialize()/yaml_parse(), e.g. $this->array = yaml_parse(file_get_contents($this->getDataFolder() . "data.yml"));.