Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this button not duplicating on my ScrollFrame?

I am very new to scrolling frames and anything will help.

What this script is suppose to do.

It's suppose to clone the current textbox then rename one of them to be TextBox1 then move the TextBox1 down 2 so I can see the change.

This does not work.

If you do fix this, please tell me what it is you did to fix this. I can't really get much off of the Developer forum nor anything on Scripting Helpers. Videos would be incredible.

The script..

--Made By MillerrIAm
--------------Variables------------
SFrame = script.Parent.ScrollingFrame
-------------Main Script------------
while true do
SFrame.TextBox:Clone()
SFrame.TextBox.Name = "TextBox1"
SFrame.TextBox1.Position = SFrame.TextBox.Position + UDim2.new(0,4,0,0)
end

4 comments

0

shouldn't you make the clone a separate variable?

0

It's creating the clone in the script itself.

0

It is in a local script.

0

Thats not what i mean. You cloned the textbox, but never did anything with it so the clone is just nil.

1 answer

✓ Accepted answer

Tbh i see nothing wrong with that unless you're defining the loaction fo the SFrame wrong, but the problem that i see in the script it you're not defining the cloned versions location so here is the fixed version:

--Made By MillerrIAm
--------------Variables------------
SFrame = script.Parent.ScrollingFrame
-------------Main Script------------
while true do
local CLONE = SFrame.TextBox:Clone()
CLONE.TextBox.Name = "TextBox1"
CLONE.Parent = SFrame -- change the loaction of this to where ever you'd like this to be.
CLONE.TextBox1.Position = CLONE.TextBox.Position + UDim2.new(0,4,0,0)
end

and also you didn't really change the cloned version's text, name, position because you were just changing what was inside the "SFrame" which would've not worked.

if worked or helped please take your time and accept.

2 comments

0

Thank you so much, this makes more sense.

1

Glad to help :D

This discussion is preserved as it was. New answers, comments, and votes are closed.