What do you want to achieve?
I want to insert a value (in this case, a name) into an array.
What is the issue?
I want to insert the name into the “Chosen” array, but it gives me a nil print.
local Chosen = {}
local Number = 1
for i, v in pairs(Morphs:GetDescendants()) do
if v:FindFirstChild("CameraV") and v:FindFirstChild("Morph") then
print(v.Name)
--Chosen[Number] = v.Name
table.insert(Chosen, v.Name)
Vueltas += 1
print(Chosen[Number])
end
end
Can you print the whole table afterwards instead of table[Number] to verify that it’s not just that index that’s nil. As far as I can tell, this code alone shouldn’t have any issues unless it never entered the if statement or loop.
my other answer was based on me misreading something, so it was nonsensical.