I made an GUI opening button:
local frame = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame script.Parent.MouseButton1Click:Connect(function() frame.Visible = true end)
but I get this error:
ScreenGui is not a valid member of PlayerGui
The name of the GUI's frame I want to make invisible is:
ScreenGui
You can use the Operation such as :WaitForChild() and :FindFirstChild()
local ScreenGui = game.Players.LocalPlayer.PlayerGui:WaitForChild("ScreenGui") local frame = ScreenGui:FindFirstChild("Frame") script.Parent.MouseButton1Click:Connect(function() frame.Visible = true end)
maybe use :findFirstChild() or :WaitForChild() like this
local player = game.Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local ScreenGui = playerGui:WaitForChild("ScreenGui") local frame = ScreenGui:WaitForChild("Frame") script.Parent.MouseButton1Click:Connect(function() frame.Visible = true end)