Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ScreenGui is not a valid member of PlayersGui, help please?

Asked by
Flip265 -14
3 years ago

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
0
Does your GUI have anything in it named ScreenGui? RazzyPlayz 497 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question