So i have been working on a GUI then i converted it to LUA by using GUI to LUA Converter, and i added a "Close" Button. But when i click Button it says this "ScreenGui is not a valid member of PlayersGui" Here is the script of the close button converted
script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.MainFrame.Visible = false end) end
I'm quite new to scripting so I may be wrong
If you use
game.StarterGui.ScreenGui.MainFrame.Visible = false
I think that might work