Skidouski
(skidouski)
March 8, 2024, 3:47am
1
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",
}
LVSKJAKL
(ROGUE)
March 8, 2024, 3:35pm
2
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
Solar_Eos
(Solar_Eos)
March 8, 2024, 5:02pm
4
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.
Skidouski
(skidouski)
March 9, 2024, 2:12am
5
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
Skidouski
(skidouski)
March 9, 2024, 2:14am
6
Players.PlayerRemoving is a good option to do this action