Created "TextButton" is not appearing in explorer or in game

Hello, I am playing around with a computer system that creates and displays “files”.
I am currently testing the creation of said files so I wrote this little script.
However, the gui doesn’t appear.
The “Print(newfile.Parent)” works and returns with Files.
But when I check Files in explorer in the gui, nothing appears and the gui doesn’t appear on the screengui.
This all takes place on a localscript.
Any help would be appreciated.
Thanks

	wait()
	local newfile = Instance.new("TextButton")
	newfile.Parent = script.Parent
	number = script.Parent:GetChildren()
	newfile.Name = "File'..#number..'"
	newfile.Position = UDim2.new(0,0,.150 * #number,0)
	newfile.Visible = true
	print(newfile.Parent)
	newfile.TextColor3 = Color3.new(0,1,0)
	newfile.Font = 'Code'
	newfile.BackgroundTransparency = 1
	newfile.Size = UDim2.new(0,71,70, 50)```

You made the background transparency to 1. That might be the reason it’s not being seen.

1 Like

Huh, yeah it appears that was the problem. For some reason it was turning the text invisible as well.
Thank you.

1 Like

No problem! One thing I’d like to add is, instead of making a new text button every single time, you could make a “template” text button and store it in some storage. Then, clone it every time you want to make a new file and just change the text, name, and position instead of changing the font, size, etc.