1 | local BCounter = (Gun [ "C" ..BCount ] ) |
2 | table.insert(BTransparentT,BCounter) |
3 | for i,v in pairs (BTransparentT) do |
4 | v.Transparency = 1 |
So I have this function that inserts these variables into a table, but I don't know how to remove them all at once. I tried doing this
1 | for i,v in pairs (BTransparentT) |
2 | table.remove(BTransparentT,v) |
3 | --But it didn't work, I keep getting an error |
Thank you for answering if you did.
Try testing this out:
1 | local MyTable = { 1 , 2 , 3 , 4 , 5 , 6 } |
2 |
3 | for i = #MyTable, 1 ,- 1 do |
4 | table.remove(MyTable,i) |
5 | end |
Now try changing it into yours.
This will clear your table of all values:
1 | BTransparentT = { } |
BTTransparent will now be an empty table.