Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this button not duplicating on my ScrollFrame?

Asked by 5 years ago

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
0
shouldn't you make the clone a separate variable? Tyler090130 619 — 5y
0
It's creating the clone in the script itself. Just2Terrify 566 — 5y
0
It is in a local script. Just2Terrify 566 — 5y
0
Thats not what i mean. You cloned the textbox, but never did anything with it so the clone is just nil. Tyler090130 619 — 5y

1 answer

Log in to vote
2
Answered by
VitroxVox 884 Moderation Voter
5 years ago
Edited 5 years ago

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.

0
Thank you so much, this makes more sense. Just2Terrify 566 — 5y
1
Glad to help :D VitroxVox 884 — 5y
Ad

Answer this question