of     1   

systematicaddict
#139365964Sunday, July 06, 2014 12:04 AM GMT

Would this work? for i,v in pairs(_G.alive) do table.remove(_G.alive, i) end
systematicaddict
#139366506Sunday, July 06, 2014 12:10 AM GMT

I thought this would be an easy question..
warspyking
#139369271Sunday, July 06, 2014 12:40 AM GMT

Well, because if how tables work, clearing the table is actually easy, depending on how you want it cleared. You could reset the variable; X = {"Hi"} X = {} And let the garbage collector remove {"Hi"} after a while, However, if your using _G then you could use that above script. However, I do not think that would reduce the size, but whatever reason you're doing this, that should not matter.
Lacryma
#139370083Sunday, July 06, 2014 12:48 AM GMT

function clear(tab) for k,v in pairs(tab) do tab[k] = nil end end empty tables that you add on to later will not be cleared by merely "resetting the variable"
warspyking
#139411271Sunday, July 06, 2014 10:50 AM GMT

@Dueling I said the gc would collect it eventually, and besides your code might clear it, but the size of the table will not be reduced. You could overload it with a ton of nils to do this, but there's no telling how many it would take.
warspyking
#139411304Sunday, July 06, 2014 10:51 AM GMT

By the way, when I said the above script I meant OP lol.
systematicaddict
#139418850Sunday, July 06, 2014 1:51 PM GMT

If the table was in a while loop, and I called functions that added players to the table, would it reset the table each time the loop ran?
warspyking
#139418931Sunday, July 06, 2014 1:53 PM GMT

Or just use PlayerAdded...
systematicaddict
#139419270Sunday, July 06, 2014 1:59 PM GMT

It's a round loop, It runs the round if game.Players.NumPlayers >1, so would it reset the table each time the loop runs?
MrNicNac
#139419296Sunday, July 06, 2014 2:00 PM GMT

Yes, OP, your script would work fine if all you did was add the players like: table.insert(_G, player)
systematicaddict
#139419454Sunday, July 06, 2014 2:03 PM GMT

Saying table.remove(_G.alive, i) would work? Or would it be; table.remove(_G.alive, _G.alive[i])
MrNicNac
#139419525Sunday, July 06, 2014 2:04 PM GMT

Just i
systematicaddict
#139419586Sunday, July 06, 2014 2:05 PM GMT

Okay, thanks.
Lacryma
#139422467Sunday, July 06, 2014 2:59 PM GMT

@war My code destroys tables within the table and dictionaries. It's fine, tyvm.
warspyking
#139428045Sunday, July 06, 2014 4:19 PM GMT

@Duelling in most cases, yes, it would. But it wouldn't reduce table size, and it would only remove the references to tables if the value inside is a table, it would not clear table values, think of using recursion for that problem. I know of no way to reduce the table size.
Lacryma
#139431453Sunday, July 06, 2014 5:03 PM GMT

um it's called nil(oh hey nonexistant) and gc
warspyking
#139433527Sunday, July 06, 2014 5:29 PM GMT

Uh yeah, what if someone made another reference, think before you script.
Lacryma
#139433742Sunday, July 06, 2014 5:31 PM GMT

"if someone" Why would I be thinking about others lol?
systematicaddict
#139433840Sunday, July 06, 2014 5:32 PM GMT

... As long as this would work I'm fine. for i,v in pairs(_G.alive) do table.remove(_G.alive, i) end
warspyking
#139434586Sunday, July 06, 2014 5:41 PM GMT

So you're admitting you're greedy and selfish.
Lacryma
#139435429Sunday, July 06, 2014 5:50 PM GMT

No I am admitting that I don't steal scripts since I know what is completely going on the entire time.
warspyking
#139435673Sunday, July 06, 2014 5:52 PM GMT

Whatever.

    of     1