Im trying to make a GUI that on click of a button it will clone a textlabel that is in the frame. Im working out the datastore later
How would I clone a TextLabel in a GUI?
2 answers
Connect to the button's MouseButton1Click event.
Next, clone the frame you want.
The reason why the frame you wanted to clone did not appear is because when cloning, the default parent is nil (I assume, at least.)
So, if you want to clone an object and make it appear on screen, you must set the parent in order to make it work.
Step three, is obviously, set the parent.
4 comments
What Do I need to add, Im a bit confused.
From your old script you sent in the comments of the orginal post, all you just need to do is set the parent. temp:Clone().Parent = path_to_parent
OHHH, it works now, BTW, do you know if there is a way for the name to change to something different every time?
Well, then you'd need to define the clone. var_name = temp:Clone(); var_name.Name = nameTable[math.random(1, #nameTable)]; var_name.Parent = path_to_parent.
Very simple
local textToclone = game.Workspace.TextLabel --- Set the workspace to wherever the textlabel's original parent is
local clonedtext = textToclone:Clone()
clonedtext.Parent = game.StarterGui.ScreenGui
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Can you provide the code you attempted?
Sure
local temp = script.Parent.Parent.ScrollingFrame.TextLabel script.Parent.MouseButton1Click:Connect(function() temp:Clone() end)