Does dictionary using player instance delete itself when player leaves?

Whenever a player leaves the game, does the dictionary containing the player instance become nil?
Here is example

local Example = {
	[game.Players.TestPlr] = "HelloWorld",
}

After the player leaves, does this automaticly become
local Example = {}
Or does the key just become nil like this

local Example = {
	[nil] = "HelloWorld",
}

That’s a good question.

I don’t have access to Studio from where I’m atm, so could I recommend printing out the value when the player leaves the game?

No it doesn’t, at least not right away - I just tested it for you:

3 Players Join… (each player is added to table on join)

player leaves…

[Instance(276B5A6C638)] = true,
[Instance(276B5A6C7B8)] = true,
[Instance(276B5A6C978)] = true

Another player leaves…

[Instance(276B5A6C638)] = true,
[Instance(276B5A6C7B8)] = true,
[Instance(276B5A6C978)] = true

No. If you’re adding player instances into a dictionary of your own, you’ll also have to remove them from your dictionary on your own.

Players.PlayerRemoving is your best bet here.

Ahh I see, thank you for testing to for me I really appreciate it! I guees what I could do is store just the userID, and occasionaly clean the table by checking if the player with that userID is still in the server

Players.PlayerRemoving is a good option to do this action