When selecting players for a game from a table ... how do I remove all players from a table.
The first option we have is to sort through the whole table and remove each entry. We can do this by a for statement, and using table.remove.
Example:
players = {"p1", "p2", "p3"} for _,v in pairs(players) do table.remove(v) end
If you are only using the table in one function (or adding to it, I should say) you can add this to your function. This example would reset the whole table when a new player joins:
game.Players.PlayerAdded:connect(function (nP) players = {} for _,v in pairs(game.Players:GetChildren()) do table.insert(v) end end)
I am sure there are also other ways, but these are the immediate ones that come to mind.