How can i make a clone of this GUI?

So wanna make it so that little + button down there creates a clone of the imagelabel Gui up there, and make it appear on the side.

But i don’t have any idea of how i could do it, like i don’t know if there’s any function that clones a GUI, i rarely mess with scripts, so yeah i don’t have a clue of how to do this.

you can use :Clone() to duplicate instances

local clone = UIObject:Clone()

Then you could just set the position down on the y axis for each instance

clone.Position = UDim2.new(clone.Position.Scale.X, 0, (clone.Position.Scale.Y - 20), 0)
1 Like

huh the output is saying that Scale is not a valid member of UDim2 for some reason

Do u want to make the Picture clone to the side?

1 Like

its better to add a scrolling frame and insert an UiListLayout into it
so the images would be organized

local YourWholeImage = --
local Cloned = YourWholeImage:Clone()
Cloned.Parent = -- That Scrolling frame
1 Like

oh it worked!!

now the image actually appears in the side, but when i try to add a second one, it just doesn’t do it

oh and when i try to add a ID to the image it doesn’t appear with those changes, i suppose the transparency shouldn’t work either:


is there a way to fix those issues?

can you show me your code?
[Char Limits]

1 Like
local Button = script.Parent
local PlayerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local ScreenGui = PlayerGui:FindFirstChild("ScreenGui")
local Frame = ScreenGui:FindFirstChild("Frame")
local Window = Frame:FindFirstChild("Window")
local SettingsWindow = Window:FindFirstChild("SettingsWindow")
local IDImage = SettingsWindow:FindFirstChild("IDImage")
local cloned = IDImage:Clone()
local Scrolling = Window:FindFirstChild("Scrolling")

ScreenGui.Enabled = true

local function onButtonClick()
	SettingsWindow.Visible = false
	cloned.Parent = Scrolling -- That Scrolling frame
end

Button.MouseButton1Up:Connect(onButtonClick)
local Button = script.Parent
local PlayerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local ScreenGui = PlayerGui:FindFirstChild("ScreenGui")
local Frame = ScreenGui:FindFirstChild("Frame")
local Window = Frame:FindFirstChild("Window")
local SettingsWindow = Window:FindFirstChild("SettingsWindow")
local IDImage = SettingsWindow:FindFirstChild("IDImage")
local Scrolling = Window:FindFirstChild("Scrolling")

ScreenGui.Enabled = true

local function onButtonClick()
    local cloned = IDImage:Clone()
    cloned.Image = "rbxthumb://type=Asset&id="..IDHERE.."&w=150&h=150"
	SettingsWindow.Visible = false
	cloned.Parent = Scrolling
end

Button.MouseButton1Up:Connect(onButtonClick)
2 Likes

YES it worked!!!

thx you so much bro!!

1 Like

np, you can put the image’s background transparency to 1 if you want.

dont forget to put that as a solution so others can see!

let’s say i wanna clone a “group of GUIs” this time;

how would i do it?

loop through all of the guis like this

for i,v in pairs(GuisFolder:GetChildren()) do
v:Clone().Parent = player.PlayerGui
end

wait…

what this i,v mean exaclty?

its a loop, it will loop through all of any instance you put, returning its index and its value(i,v)

1 Like

cause it’s saying tis in the output

I forgot to type do after GetChildren()) fixed.

huh now it’s saying this

What do u want to do exactly now