cus @MCAndRobloxUnited said it is possible; and also gave a convincing reason.
local part = Model:GetChildren().Part
1
Yes, it is possible. In Lua, .Part is the same as ["Part"] and the :GetChildren() method returns a table. Thus, MCAndRobloxUnited is correct in the syntax, but not the actual implementation.User#251150— 6y
0
That will not work if "Part" is not an index. Because :GetChildren() returns an array of the objects where the values in that array are the objects, if you try to index "Part," the variable part will be nil (Note: The array is numerically indexed). User#251150— 6y
0
so ur stating that Model:GetChildren().Part == Model:GetChildren("Part")??? or??TheluaBanana946— 6y
0
No, I am saying Model:GetChildren()["Part"], where :GetChildren() returns a table.User#251150— 6y
Some people have been pointing out the possible confusion that may result from my comments. When I say that :GetChildren() returns a table, I am referring to an array. The "table" type in Lua encompasses arrays, dictionaries, etc. I would also like to clarify that :GetChildren() returns a numerically indexed array, so doing .Part would NEVER work with :GetChildren().User#251150— 6y
1
Trying to get the value at the index of a string in a table that either 1.) is numerically indexed or 2.) has no ["Part"] index will result in a nil value.User#251150— 6y
1
If a table has a value at the index "Part" then yes, .Part would work the same as ["Part"].User#251150— 6y