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

How to clone a GUI without multiplying them?

Asked by
Dxlcra 0
2 years ago

I made a button where if u click the button, the button clones, i place the button in the frame and when i click it once, it clones once but when i click it for the second time, it clones twice, its like its multiplying instead of adding up. heres the code:

`local frame = script.parent.parent`

local button = script.parent

`button.mousebutton1click:connect(function()`
`local NewButton = frame:FindFirstChild("TextButton"):clone()
NewButton.Name = "NewButton"
NewButton.Parent = frame`
`end)`
0
you've made it quite hard to read when you spammed `` on your code lol Antelear 185 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

it's bc the buttons are stacked on each other and so u click them all at the same time.

Just add in a UIGridLayout into the frame, it will space them out for you.

0
I already add a UIGridLayout, what i meant is that when i click the button for the second time, my expectation was for it to clone once, for ex, 1 +1. But it multiplies instead, for ex, 1 +2 Dxlcra 0 — 2y
0
I haven't been able to reproduce this mine works just fine TehEpixNeon 0 — 2y
Ad

Answer this question