UI wont clone properly

I was trying to make a Radio so when I enter the text in a textbox it’d clone a frame with the text and if I were to send another message it’d clone under it, I’m using a UI list layout however it for some reason isn’t properly cloning.

My script:

local textboxconfirm = script.Parent.Parent.textboxenter.done

local textbox = script.Parent.Parent.textboxenter.TextBox

local frametoreplicate = game:GetService(“ReplicatedStorage”).REPLICATION

textboxconfirm.MouseButton1Click:Connect(function()

frametoreplicate:Clone()

frametoreplicate.Parent = script.Parent.Parent.ScrollingFrame

frametoreplicate.MESSAGE.Text = textbox.Text

end)

My script only clones the text and the frame however the frame isn’t in a UI List layout.

I’ve checked F9 it shows no errors.

You have to save the clone as a variable and reference that for the parent and message.

local clone = frametoreplicate:Clone()

clone.Parent = script.Parent.Parent.ScrollingFrame
-- and so on

Kind of a common programming mistake for beginners.

1 Like

I tried that however that is not fixing my issue heres the script:

local textboxconfirm = script.Parent.Parent.textboxenter.done

local clone = game:GetService(“ReplicatedStorage”).REPLICATION:Clone()

local textbox = script.Parent.Parent.textboxenter.TextBox

textboxconfirm.MouseButton1Click:Connect(function()

clone.Parent = script.Parent.Parent.ScrollingFrame

clone.MESSAGE.Text = textbox.Text

end)

local textboxconfirm = script.Parent.Parent.textboxenter.done

local textbox = script.Parent.Parent.textboxenter.TextBox

textboxconfirm.MouseButton1Click:Connect(function()

local clone = game:GetService(“ReplicatedStorage”).REPLICATION:Clone()

clone.Parent = script.Parent.Parent.ScrollingFrame

clone.MESSAGE.Text = textbox.Text

end)
1 Like