For a replacing feature to work, I need to be able to change the index of a child. For example, let’s say the hierarchy looks like this:
Folder
- Value1
- Value2
- Value3
I would like to be able to do something like this:
changeIndex(Value3,2)
Changing it to:
Folder
- Value1
- Value3
- Value2
I have tried doing Instance:GetChildren()[2] = child, and also have tried table.insert. I can’t find a way to do this, so if you know how, please tell me! Thanks for reading.
Test code:
local new = Instance.new("StringValue",workspace.StringValues) new.Name = "NewValue" workspace.StringValues:GetChildren()[2] = new
print(workspace.StringValues:GetChildren()[2].Name)