LocalScript inside of the Menu and inside of the MenuFrame:
local Players = game.Players
local Player = Players.LocalPlayer
local PlayerGui = Player.PlayerGui
local Gui = PlayerGui.Gui
local ScreenGui:ScreenGui = PlayerGui.ScreenGui
script.Parent.Parent.Enabled = true
if script.Parent.Parent.Enabled == false then
ScreenGui.Enabled = true
Gui.Enabled = true
else
ScreenGui.Enabled = false
Gui.Enabled = false
end
I tried everything, changing the script, making :ScreenGui on it adding locals, and no, it didn’t worked.
(Yes I’m sorry to say, even though the topic is closed and been solved and saying it very lately.) I do not want to put :WaitForChild, once I’ve put that, it seems like it worked perfectly fine.
local Players = game.Players
local Player = Players.LocalPlayer
local PlayerGui = Player.PlayerGui
wait(0.1)
local Gui = PlayerGui.Gui
local ScreenGui:ScreenGui = PlayerGui.ScreenGui
script.Parent.Parent.Enabled = true
if script.Parent.Parent.Enabled == false then
ScreenGui.Enabled = true
Gui.Enabled = true
else
ScreenGui.Enabled = false
Gui.Enabled = false
end
local Players = game.Players
local Player = Players.LocalPlayer
local PlayerGui = Player.WaitForChild("PlayerGui")
local Gui = PlayerGui:WaitForChild("Gui")
local ScreenGui:ScreenGui = PlayerGui.ScreenGui
script.Parent.Parent.Enabled = true
if script.Parent.Parent.Enabled == false then
ScreenGui.Enabled = true
Gui.Enabled = true
else
ScreenGui.Enabled = false
Gui.Enabled = false
end
I’m not sure that this script will work, but I at least suggest you to try it out at least once.
Isn’t making it easy kind of the point…?
There’s not really a reason to make it more complicated than it should be, :WaitForChild is completely fine to use even for people that have coded for years.