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:
This is a local script located in a GUI in StarterGUI, and its cloning the test TextLabel, the child of Frame:
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
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!