Help with cloning UI

Hi all,

I’ve been making a building game of sorts, and i’ve come to an issue.
I want there to be a ScrollingFrame which contains all of the items in the game. When the game runs, there are copies being made, but all of these are transparent for some reason, despite having their transparency set to 0

the code is as follows:


local itemsToShow = game.ReplicatedStorage.ThingsToPlace:GetChildren()


local ScaleY = 0.01 -- Placement of the image label inside of the scrolling frame

for i,v in pairs(itemsToShow) do
	local newItem = script.Parent.Frame.test:Clone()

	----------------------------------

	newItem.Parent = game.StarterGui.gui.Frame
	newItem.Name = v.Name


	newItem.Size = UDim2.new(1, 0, 0.05, 0)

	newItem.Position = UDim2.new(0, 0, ScaleY, 0)
	newItem.Transparency = 0
	-----------------------------------

	ScaleY +=0.05

	newItem.Text = v.Name

end

ThingsToPlace is in replicated storage and looks like this:
image

This is a local script located in a GUI in StarterGUI, and its cloning the test TextLabel, the child of Frame:
image

This is the result:

It would seem studio is also acting up a bit, for i can delete and drag items but they won’t follow or change either


in this image i’ve deleted the Frame, but its still showing??

Any help would be greatly appreciated!

you’re deleting the images in the StarterGui, you must do it in the PlayerGui.

Use PlayerGui along with BackgroundTransparency, because Transparency is deprecated.

local players = game:GetService("Players")
local localplayer = players.LocalPlayer
local playergui = localplayer:WaitForChild("PlayerGui")

local gui = playergui:WaitForChild("gui")
local frame = gui:WaitForChild("Frame")

local repstore = game:GetService("ReplicatedStorage")
local thingsToPlace = repstore:WaitForChild("ThingsToPlace")
local scaleY = .01

for i, v in pairs(thingsToPlace:GetChildren()) do
	local newItem = script.Parent:WaitForChild("Frame"):WaitForChild("test"):Clone()
	newItem.Name = v.Name
	newItem.Size = UDim2.fromScale(1, .05)
	newItem.Position = UDim2.fromScale(0, scaleY)
	newItem.BackgroundTransparency = 0 -- Unsure of what "test" is, but I don't think GuiObjet supports Transparency anymore
	scaleY += .05
	newItem.Text = v.Name
	newItem.Parent = frame
end

Yes, this is most likely the answer, because it doesn’t even delete when you delete the frame.

Instead, change this:

newItem.Parent = game.StarterGui.gui.Frame

to this:

newItem.Parent = script.Parent.Frame

Thank You! I was unaware that Transparency was deprecated (its been a hot minute since i’ve been on Roblox), and i’m quite new to UI scripting, so this was really helpful!