Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

If a player leaves a game are they automatically removed from any tables they are a part of?

I am making a racing game and I have a table, full of players currently in the race. If one of those players leaves the game will they automatically be removed from said table?

1 answer

You could do this:

game.Players.PlayerRemoving:connect(function(oldplr)
	table.remove(TABLENAME, oldplr)
end)

And I don't think they are automatically removed

1 comment

3

They aren't. Assume nothing in programming is done for you, because most of the time it isn't. And your removeal code will only work if the table is a Dictionary. If it's just a list, you'll have to loop through it to find the player.

This discussion is preserved as it was. New answers, comments, and votes are closed.