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

1 comment
Does your GUI have anything in it named ScreenGui?