I want to make a button that when clicked, will get a list of all players.
The only problem to this is that the button is invisible/transparent but in the code, I made all transparency values to 0 and visible to true
local kick = script.Parent
local function Choose()
local players = game.Players:GetPlayers()
for i = 1,#players do
local newgui = Instance.new("TextButton")
newgui.Name = "newgui"
newgui.Parent = game.StarterGui.ScreenGui
newgui.BackgroundTransparency = 0
newgui.Visible = true
newgui.ZIndex = 1
newgui.Position = UDim2.new(0.5, 0,0, 0)
newgui.Size = UDim2.new(0, 200,0, 50)
newgui.Text = tostring(players[i])
end
end
kick.MouseButton1Click:Connect(Choose)
I can see it is on the screen by selecting it in the explorer but it is just invisible. The text value is equal to denbra37 but it is transparent too.

4 comments
I don't if this will help, but maybe try creating a frame that will hold all your text buttons, then set the frame visible? Also, is the 'ScreenGui' already existing? Maybe you need to define it beforehand.
uhhh maybe try at the end visible = false?
screenGui is already existing
I've parented it to a frame but it doesn't work too even if frame.ten