Before you think this is unrelated to scripting, I am messing around with GUIs, ie... full on scripting the entirety of the GUI, no actual physical part in studio, just a script in StarterGui.
As far as I have gotten is to the 'Frame' for it, but when I test it in-game, and look inside of my PlayerGUI, it shows that the Frame is inside of the ScreenGui, but it isn't visible, with the visible property automatically set to true, I simply can't see it.
Before I give you the script, I have checked the output, there is nothing that comes out of it.
Here is a screenshot to show you, in-case you haven't been able to follow along. http://prntscr.com/fr279h
1 | local x = Instance.new( "ScreenGui" , game.Players.LocalPlayer.PlayerGui) |
2 | x.Name = 'Vaux GUI' |
3 |
4 | local f = Instance.new( "Frame" , game.Players.LocalPlayer.PlayerGui [ 'Vaux GUI' ] ) |
5 | f.Active = true |
Unefficient use of parenting an instance.
Source : devforum.ROBLOX
Wrong version :
1 | local x = Instance.new( "ScreenGui" , game.Players.LocalPlayer.PlayerGui) -- Wrong! |
2 | x.Name = 'Vaux GUI' |
3 |
4 | local f = Instance.new( "Frame" , game.Players.LocalPlayer.PlayerGui [ 'Vaux GUI' ] ) -- Wrong! |
5 | f.Active = true |
Corrected version:
1 | local x = Instance.new( "ScreenGui" ) -- Create Instance. |
2 | x.Name = 'Vaux GUI' -- Make adjustments to properties. |
3 | x.Parent = game.Players.LocalPlayer.PlayerGui -- Parent the instance in the last line possible. |
4 |
5 | local f = Instance.new( "Frame" ) -- Create frame. |
6 | f.Active = true -- Make frame active. |
7 | f.Size = UDim 2. new( 0.25 , 0 , 0.25 , 0 ) --Provide a size for the frame, because the initial size is UDim(0,0,0,0) |
8 | f.Parent = x -- Parent the frame to the gui, by just stating the variable "x" which is defined above. |
Should work now.
I am still learning RbxLua.
Thank you for reading.