lua tables

Hi, so player.GetAll() returns every player, I need to run script on only about 10% of players online and these players will change, so I’m asking how can I declare a table that can be whatever length that I can add and remove players from. So I can run script on all the players in this table instead of looping every single player? If I havn’t explained properly please message, Thanks for the help in advance!

If there are any special conditions for the players, check if the player has those conditions met, then run the function for them.

Alternatively, add them to a global table and loop through that. You didn’t really give enough information on whats so special about that 10% or what so I cant go in depth on methods

[editline]7th February 2016[/editline]

For example you could add them to a table when the round starts, or when they spawn, or when they change to a certain class. What’s the application?

Hey sorry for the late reply, i did some research and found something i couldnt.

In the end i did local table = {}

if (conditions met) then
table[ ply:SteamID64() ] = ply