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
local mainScreen = game.StarterGui.ScreenGui.MainScreen
mainScreen.Visible = true
script.Parent.MouseButton1Click:Connect(function()
    mainScreen.Visible = false
end)

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.

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

Answer this question