What is the issue with storing player data in tables, data is shared when it should not be

Of course. But its not only about using Player instance or a string made by the name or the UserId. Mandatory you should flush the table you created when player leaves, probably you already know that, keeping that record on the module after player leaves will create a huge memory leak no matter if you are using the player instance, name or whatever string/number you like.

The real issue about player instances, is that are not garbage collected when player leaves, those and characters are just parented to nil and preserved on server… causing memory leaks.
That issue is already being addressed on recent updates of roblox.
If you flush the table you created and setting it to nil thats enough for your module. (the idea is not keeping a hard reference of that player instance anywhere, and flushing the data ofc)

If you can enroll into the player/character real Destroy of the roblox update the better.
Real destroy of player instance

1 Like