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

Why doesn't the visibility = false when it gets clicked?

Asked by 5 years ago
1local mainScreen = game.StarterGui.ScreenGui.MainScreen
2mainScreen.Visible = true
3script.Parent.MouseButton1Click:Connect(function()
4    mainScreen.Visible = false
5end)

Please tell me if it needs a remote, because I'm not so sure.

0
Is it a Server Script or Local Script? CaptainAlien132 225 — 5y
0
@CaptainAlien123 its local bluemountainlion 56 — 5y

1 answer

Log in to vote
1
Answered by
EteraW 77
5 years ago

Items in StarterGui will be in PlayerGui. Do this.

1local plr = game.Players.LocalPlayer
2local mainScreen = plr.PlayerGui.ScreenGui.MainScreen
Ad

Answer this question