|
| 18 Sep 2013 06:25 PM |
tab = {"I", "Hate", "you"}
function reorganize(tab) for index, val in pairs(tab) do table.remove(tab, index) end repeat wait(0.1) until #tab == 1 table.remove(tab, 1) end reorganize(tab) print(#tab) |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 18 Sep 2013 06:27 PM |
tab = {"I", "Hate", "you"}
function reorganize(t) for index, val in pairs(t) do val = nil end end reorganize(tab) print(#tab) |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2013 06:32 PM |
| Zach yours doesn't work like at all. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 18 Sep 2013 06:35 PM |
I'm guessing you're trying to remove all of the table values?
If so then, yes, you're right. I made a mistake.
tab = {"I", "Hate", "you"}
function reorganize(t) for index, val in pairs(t) do t[index] = nil end end reorganize(tab) print(#tab) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|