In a Gui, I use getChildren() with a for to move items from the GUI to another place, only she doesn’t want this to move anymore and there is no error. Its worked before but is no longer work and i don’t have backup of before.
This is a localScript
local plrMessageFolder = Instance.new("Folder")
if not messages:FindFirstChild(plr.Name) then
plrMessageFolder.Parent = messages
plrMessageFolder.Name = plr.Name
end
for i, obj in pairs(messageScrollingFrame:GetChildren()) do
print("called")
if obj:IsA("TextButton") then
print("moved")
obj.Parent = plrMessageFolder
end
end
In my console,called and moved is printed but the obj.Parent don’t change
(plr is a player Object)
Could you try parenting the obj to the workspace, instead of the plrMessageFolder. I wonder if the problem has to do with the Parenting, or if it is a problem with the plrMessageFolder.
Yes that should work I think. I believe that the problem might have been that you only parent the folder in an if loop. If the if statement doesn’t trigger, the folder is parented to “nil” so you can’t parent anything to it.
Then the plr name must be wrong. When you call the function addUserInList(plr), are you sure that you call it with the player. Try at the very top printing
Wow this is so confusing. Maybe see if this prints the correct folder:
if obj:IsA("TextButton") then
print("moved")
local folderToMove = messages:FindFirstChild(plr.Name)
print(folderToMove.Name, folderToMove.Parent)
obj.Parent = folderToMove
end
From what I know the Configuration instance is used for storing Value objects.
I don’t know if things inside there don’t work if they’re not a value object, but try replacing the messages configuration folder instance with a regular folder.