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

Why doesn't the ScreenGui become invisible?

Asked by 5 years ago

Heres what I have

game.Players.PlayerAdded:Connect(function()
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = false
end)

Why isnt this make the gui invisible?

2 answers

Log in to vote
0
Answered by 5 years ago

the gui might take some time to spawn?

Ad
Log in to vote
0
Answered by 5 years ago

It's because you cannot grab the PlayerGui from a Server Script. Use a local script instead.

If you ARE using a local script, do this:


local player = game.Players.LocalPlayer repeat wait() until player.PlayerGui.ScreenGui.Frame --wait for it to load player.PlayerGui.ScreenGui.Frame.Visible = false

this will make the Frame invisible every time the player enters the game or resets.

Answer this question