for y,z in pairs(scanZoneTest) do
print(z:GetDescendants()[num])
for i, v in pairs(z:GetDescendants()) do
The issue is that if I do z:GetDescendants()[num] it gets a valid descendant of workspace, but if i do the for loop (for i, v in pairs(z:GetDescendants()) do), all v logs is Camera, not any other descendant. What is wrong?
local scanZoneTest = { game.Workspace }
for y,z in pairs(scanZoneTest) do
print(z:GetDescendants()[num]) -- prints all descendants when indexed
for i, v in pairs(z:GetDescendants()) do
print(v) -- only prints Camera out of all descendants in workspace
end
end
Works for me, in starter player scripts and in server script service. I’m assuming you do have more than a Camera in the workspace, could you post your workspace?
local scanZoneTest = { game.Workspace }
for y,z in pairs(scanZoneTest) do
warn(z:GetDescendants()) -- warns the descendants table (verify your data)
for i, v in pairs(z:GetDescendants()) do
print(string.format("Found Descendant \"%s\" [Path: %s]", tostring(v), v:GetFullName()))
end
end
Works just fine for me. Maybe show us what it’s outputting in a screenshot?
Nope, it didn’t change the behavior for me at all.
What else does your plugin do before this is printing? Because this is a really weird issue in my opinion.