Is There Anyway To Merge Scripts?

I was wondering if there was anyway to merge scripts instead of doing it one by one.

Let’s say that I had 2 scripts.

local Baseplate = Instance.new("Part")
Baseplate.Name = "Baseplate"
Baseplate.Anchored = true
Baseplate.Color = Color3.fromRGB(255, 0, 0)
Baseplate.Size = Vector3.new(512, 20, 512)
Baseplate.CFrame = CFrame.new(-511.76443481445, -10, 0)
Baseplate.Locked = true
Baseplate.formFactor = Enum.FormFactor.Symmetric

Baseplate.Parent = workspace

local Baseplate = Instance.new("Part")
Baseplate.Name = "Baseplate"
Baseplate.Anchored = true
Baseplate.Color = Color3.fromRGB(99, 95, 98)
Baseplate.Size = Vector3.new(512, 20, 512)
Baseplate.CFrame = CFrame.new(0, -10, 0)
Baseplate.Locked = true
Baseplate.formFactor = Enum.FormFactor.Symmetric

Baseplate.Parent = workspace

Is there anyway to merge those two scripts to 1 instead of doing it manually?

Example

(Merged Script)

local Baseplate = Instance.new("Part")
Baseplate.Name = "Baseplate"
Baseplate.Anchored = true
Baseplate.Color = Color3.fromRGB(255, 0, 0)
Baseplate.Size = Vector3.new(512, 20, 512)
Baseplate.CFrame = CFrame.new(-511.76443481445, -10, 0)
Baseplate.Locked = true
Baseplate.formFactor = Enum.FormFactor.Symmetric

Baseplate.Parent = workspace

local Baseplate = Instance.new("Part")
Baseplate.Name = "Baseplate"
Baseplate.Anchored = true
Baseplate.Color = Color3.fromRGB(99, 95, 98)
Baseplate.Size = Vector3.new(512, 20, 512)
Baseplate.CFrame = CFrame.new(0, -10, 0)
Baseplate.Locked = true
Baseplate.formFactor = Enum.FormFactor.Symmetric

Baseplate.Parent = workspace
1 Like

What exactly do you mean by this part?

As you can see in the example, the 2 scripts where merged into 1 script. Is there a plugin to do this? (Or Something Else)

Copy and paste code from one script into the other?

But I would have around 12 scripts and I don’t have time for that. :cry:

I assume you want to merge the sources of script instances (for whatever reason), so you can i.e. use the command bar along with a simple for loop and the script.Source property.

Parent all scripts you want to merge to for example a folder in workspace, then run this:

local s = Instance.new("Script") 
s.Name = "Result" 

for i, v in pairs(workspace.Folder:GetChildren()) do
    s.Source = s.Source .. "\n ".. v.Source
end

s.Parent = workspace.Folder
5 Likes

I might create that into a plugin and credit you for this. Thanks!

It would take longer to wait for posts to get your answer than to copy from 12 scripts but lucky you got an answer, I never knew a script had a Source property anyways, probably plugin stuff.

3 Likes