[Plugin] Object packer (puts selected objects in organised folders!)

Hello fellow developers!
Have you ever had to go trough the pain of Grouping every object in ReplicatedStorage, ServerScriptService, StarterGui just so you can then send it through a rbxm/roblox model?..
I have created a plugin to automate this, you just select the objects and press a button!

Video:

Get the plugin:
https://www.roblox.com/library/8243945680/Object-packer

Source code:

local ChangeHistoryService = game:GetService("ChangeHistoryService")
local Selection = game.Selection
local toolbar = plugin:CreateToolbar("Pack up")

local Button = toolbar:CreateButton("Pack up", "Pack selected objects in to organised folders", "rbxassetid://5412272324")

Button.ClickableWhenViewportHidden = true

Button.Click:Connect(function()
	ChangeHistoryService:SetWaypoint("Packed objects")
	local MainFolder = Instance.new("Folder",workspace)
	MainFolder.Name = "Pack"
	local function AddToFolder(object,last)
		local Find = MainFolder:FindFirstChild(object.Parent.Name)
		local Clone = object:Clone()
		if Find then
			Clone.Parent = Find
		else
			local Folder = Instance.new("Folder",MainFolder)
			Folder.Name = object.Parent.Name
			Clone.Parent = Folder
		end
		if last == true then
			Selection:Set({MainFolder})
			plugin:SaveSelectedToRoblox()
		end
	end
	for index,value in pairs(Selection:Get()) do
		local Last = index == #Selection:Get()
		AddToFolder(value,Last)
	end
end)
7 Likes

It would be nice if you were to add “Unpack” button in the toolbar. :+1:

1 Like