Drop Tool into Folder in Wokspace

  1. What do you want to achieve?
    I want to drop a tool and have the parent of the tool be a folder in the workspace.

  2. What is the issue?
    The issue is that when I drop the tool, it goes straight into the workspace, not the folder I want it to go to.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried to change the tool parent by checking if the tool’s parent is Workspace and using if then to change it to the folder I want, but it isn’t working.

tool = script.Parent

if tool.Parent == game.Workspace then
	tool.Parent = game.Workspace.Folder
end

Is it a localscript or a regular script?

Was there an error in output?

What did it say?

it’s a server script and there is no error in ouput :confused:

Is the script in the tool itself or in the handle?

You may just need to add/remove a .Parent in there somewhere

-- server:

workspace.ChildAdded:Connect(function(tool)
    if tool:IsA("Tool") and tool:FindFirstChild("Handle") then
        tool.Parent = workspace.Folder
    end
end)

You should also rename the folder to ‘Tools’ or something.

1 Like

So i tried using this but it didn’t work, BUT i did edit it a bit to look like this and it did work but I read that using “wait()” to “fix” an issue isn’t really the solution so idk if this is a smart thing to do?

workspace.ChildAdded:Connect(function(item)
	if item:IsA("Tool") then
		wait()
		if not item.Parent:IsA("Folder") then
			item.Parent = workspace.Comp.Comics
		end
	end
end)

Use this instead then:

workspace.ChildAdded:Connect(function(item)
	if item:IsA("Tool") then
		if not item.Parent:IsA("Folder") then
			task.defer(function()
				item.Parent = workspace.Comp.Comics
			end)
		end
	end
end)