if MenuGui.Visible == false
then
script.Parent.Parent.Parent.Parent.IgnoreGuiInset = false
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", true)
end)
end
I already have the code execute in true
script.Parent.Parent.Parent.Parent.IgnoreGuiInset = false
and
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", true)
end)
hello, sorry I think I marked it (I wrote it on Google translation because I’m French and I had to forget to copy it) so it’s the code to deactivate the topbar so that my game menu takes everything the screen but I would like it to reactivate once my menu is no longer visible
I think I understand where you are coming from, try and use :SetTopbarTransparency, as seen in this thread,. Also displayed in this (I admit copied from that thread) example,
local playerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
playerGui:SetTopbarTransparency(1)
if game.StarterGui.MenuGui.Enabled == true then
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", false)
end)
else if game.StarterGui.MenuGui.Enabled == false then
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", true)
end)
end
end
@DonooZeus First you should learn to write a script. Second, I don’t really understand what your problem is. Do you even know what pcall does and what you get an error message in the output?
So I would like to try to help you, but because I don’t know your problem and therefore don’t know where I could improve your code, don’t admit anything. You really not need pcall, only use this if you know what this does. If not then you can google.
You are controlling if the Gui from StarterGuiService is enabled, but you need to controll the Gui from the PlayerGui folder:
local Player = game.Players.LocalPlayer
if Player.PlayerGui.MenuGui.Enabled == true then
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", false)
end)
else if Player.PlayerGui.MenuGui.Enabled == false then
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", true)
end)
end
end
This is the solution to your problem:
You control the MenuGui in the server, but everything in the StarterGui is copied to the PlayerGui of each player. So everything in the StarterGui remains unchanged in other words:
You must always control in PlayerGui, never in StarterGui.