It has a quite weird behaviour.
for i, v in pairs(Mine1:GetChildren()) do
if v:IsA("BasePart") then
local _2 = MyVectorTable
local _3 = v.Position
_2[#_2 + 1] = _3
end
end
This iterates through the mine folder and adds a new block pos to MyVectorTable.
local positions = { Vector3.new(6, 0, 0), Vector3.new(-6, 0, 0), Vector3.new(0, 6, 0), Vector3.new(0, -6, 0), Vector3.new(0, 0, 6), Vector3.new(0, 0, -6) }
These are all the blocks that will be added. (MiningBlock.Position + the element)
I iterate through positions and add MiningBlock.Position + the element)
. After that I check if the PosY is greater than 0. After that I check if the NewPosition (MiningBlock.Position + the element)
) already exist. After that if its not any of them, it will only make a block and add to the vector table.