There is a problem with this example where the player objects sometimes is undefined so the server crashes to bypass this we need to put it in a try and catch but if that happens we still need to remove the player from our list, so I wrote a system that checks if the player is connected and if he isn't, he gets removed from the list.
There is a problem with this example where the player objects sometimes is undefined so the server crashes to bypass this we need to put it in a try and catch but if that happens we still need to remove the player from our list, so I wrote a system that checks if the player is connected and if he isn't, he gets removed from the list.