Title says it all
To explain:
local property = "Name"; -- Name is a property every instance has.
for i,v in next, workspace:GetChildren() do
if (v[property]) then
print("found: "..tostring(v)..";\n property: "..tostring(property));
end
end
The above doesn't error because every instance in workspace has a property "Name"...
However:
Instance.new("StringValue", workspace);
local property = "Value"; -- Not every instance has this property
for i,v in next, workspace:GetChildren() do
if (v[property]) then
print("found: "..tostring(v)..";\n property: "..tostring(property));
end
end
The above errors saying that "Value" is not a valid property of camera? Why does it error? I clearly state that IF the instance has a property of "Value", then to print. It completely ignores it.

1 comment
Man, the way you're using lua...it looks like another language. This is totally beyond me.