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

my GUI script wont clone its parent when script starts?

Asked by 4 years ago
Edited 4 years ago

Im trying to make an infinite scroll(basically social media).

but it wont clone itself below the next. Also, when I switch Canvas size to infinite it turn invisible.

(This is with scrolling frames and labels inside) (GUI)


while true do wait(0.2) Instance.new() local guiObject = script.Parent guiObject.Position = UDim2.new(0, 0, 0.5, 0.1) wait(0.2) end
0
In the code provided, you never said to clone anything? What line does it clone because I'm not seeing it. beeswithstingerss 41 — 4y
0
I thought instance.new() created a new clone? snipperdiaper 120 — 4y
0
Answered:D Was a simple fix, you're script works for the most part, just cloning is different. skyaz1 72 — 4y

1 answer

Log in to vote
1
Answered by
skyaz1 72
4 years ago
Edited 4 years ago

In order to clone something, you need to use :Clone(), Instance.new creates a completely new object(a part for example).

while true do
wait(0.2)
local guiObject = script.Parent:Clone() -- creates a clone of parent
guiObject.Position = UDim2.new(0,0, 0.5,0.1)
wait(0.2)
end
Ad

Answer this question