local BCounter = (Gun["C"..BCount])
table.insert(BTransparentT,BCounter)
for i,v in pairs(BTransparentT) do
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
for i,v in pairs(BTransparentT)
table.remove(BTransparentT,v)
--But it didn't work, I keep getting an error
Thank you for answering if you did.

3 comments
In order to remove something from a table. Start from collecting them from the end to the start. Not from the start to the end and neither using pairs (May causing errors)
Thank you, it did work but can you explain to me why I cant I start from the start to end?
@Mr_MilkysButler The reason why that you can't start from the start to the end is that when you do like this {1,2,3} Then It will delete the first variable. And then it turns into this {2,3} After that it will destroy the second variable and turn to this {2} So that's why.