If a player is removed from the game (quit), is their Player object removed from Lua tables that I may have them stores in?
For example, I may still need specific data if a player left early, such as their match score:
I am currently saving this in my match state machine within data.Scores and it is stored as [Player: Player] = 0: Number
If a player leaves the game, can I still access this or is it wiped?
(or some other cleanup method if you still need to access data after they leave, but you get the idea; you have to clear it yourself)
Until you do that manual cleanup though, the player object will still exist in your table key, even though the player is not in the game. It is destroyed, so it won’t have a parent, but you can still hold a reference to it.
Perfect! Yep this is what I am currently doing. I am clearing the match data on removal. I think I was having a brain fart thinking about whether player objects automatically got cleared up. Glad they do not. Thanks for the help