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
1 | script.Parent.MouseButton 1 Click:Connect( function () |
2 | game.Players.LocalPlayer.PlayerGui.ScreenGui.MainFrame.Visible = false |
3 | end ) |
4 | end |
I'm quite new to scripting so I may be wrong
If you use
1 | game.StarterGui.ScreenGui.MainFrame.Visible = false |
I think that might work