The Name
From what research I did, I found that that's the hex for the table, based upon this question on stackoverflow.
The Code
When you want to destroy children that're in a table, you need to use a for loop to iterate through said table. A for loop (I'm speaking of a generic for loop), it returns two values: the index, and the value for said index.
local ChildrenInModel = Model:GetChildren()
for _, v in next, ChildrenInModel do
print(v.Name, 'is in table!')
end
Side note; when attempting to use a method on a table, such as Destroy, it can look pretty weird when you look at it like this;
local ChildrenInModel = {Part1, Part2, Part3, etc...}
ChildrenInModel:Destroy()
{Part1, Part2, Part3, etc...}:Destroy()
Stuff touched on
For loops - A loop that counts up or down depending on the values given to it.
Generic For loops - A for loop that iterates through a table that returns the index for its first value, and the value for the index. (I recommend reading up on it for a better explanation.)
Destroy - Pretty self explanatory. :p
If you have any questions, feel free to ask. :)
I hope this helped! :D
2 comments
whats the point of 'i' then
"i" is the index of the table, it's the same as the numerical position of the item, so if I have a table {"one", "two", "three"} then the index for the value "two" is 2. Another way to write the the keyvalue is table[1] since [1] is the index of the item in the first slot of the table