Not sure why this script wouldn’t work. No errors in the output either which is making it difficult for me to find the issue. I’m not great at scripting so it’s probably an obvious issue. Here’s my explorer.
The Gui which a player sees is not StarterGui, it is PlayerGui which is located under the LocalPlayer [LocalPlayer is only accessible through local scripts]. When the player’s Player.Character spawns for the first time all of the contents of StarterGui are automatically copied into the player’s PlayerGui.
Here you would do something like
local Player = game:GetService("Players").LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local MainGui = PlayerGui:WaitForChild("MainGui")
script.Parent.MouseButton1Click:Connect(function()
MainGui.Enabled = false
end)
Basically you’re not supposed to change the StarterGui, instead you change the PlayerGui which is the gui player sees on their screen and you’d do that by doing this: