title
foe example
ControlPanel.MovieConfiguration[1]
i’d want that to return EditMovie; is this possible?
title
foe example
ControlPanel.MovieConfiguration[1]
i’d want that to return EditMovie; is this possible?
Yes you can do this:
ControlPanel.MovieConfiguration:GetChildren()[1]
This would return the first child, which is EditMovie in this case
than kYou
wHat about Trying to get the index of it without a for loop?
for example
print(ControlPanel.MovieConfiguuration.EditMovie)
i’d want that to print 1
You can just use table.find()
for this.
table.find(ControlPanel.MovieConfiguration:GetChildren(), asset) --asset is the asset you want to grab the index of
Firing GetChildren()
sends you back an array of instances, so you can send that through table.find() to treat it as if it were just a regular table.
You can recursively search using findfirstchil.
print(ControlPanel:FindFirstChild('EditMovie', true))
To clear confusion, this doesn’t return an index, just the asset itself. Recursively searching using FindFirstChild()
more or less just searches through the whole tree it’s being called on.
I think getting the asset was the point
Thank u
refgdrgjnuidrghjunigrdgrsd
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.