You should make an array and store the variable to the array with the key as the player's name or entity ID.
emm... create an array, add a key by player name... example: $array = []; $array[$player->getName()] = "Example"; echo $array[$player->getName()]; //Example
? After the class deceleration. Public $var Then you can use it anywhere in the plugin with: $this->var
I write, anywhere in one function... If u need use var in anywhere of plugin, u can create a var by OOP.
Yes, but he wants to store the variable, and normally he only has one player in his function so saving a local variable is pointless.