The code is in a localscript, and makes TopbarEnabled false ok, but before and after it isn't willing to print whether TopbarEnabled is currently true or false

When I include the print commented at line 2 it breaks the pcall

pcall(function() 
	--print(game.StarterGui:GetCore("TopbarEnabled"))
	game.StarterGui:SetCore("TopbarEnabled", false)
end)

while wait(1) do
	print("Starting new attempt")
	pcall(function()
		print(game.StarterGui:GetCore("TopbarEnabled"))
	end)
end

7 comments

2

If you try to print "game.StarterGui:GetCore("TopbarEnabled")", it will throw an error saying "GetCore: TopbarEnabled has not been registered by the CoreScripts"

0

Looked at parameters of GetCoreGuiEnabled and GetCoreGuiEnabled requries a parameter of Enum.CoreGuiType, so I think that should work...

0

got a true value with game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.All)

0

Yeah, so for some reason "TopbarEnabled" isn't there when it should be.

0

Why not just keep track of the visibility of the Topbar? It's not like anything but the programmer can change it.

0

The plan is to use the script in multiple games and I don't want to have to change the variable for each place

0

If you try to print "game.StarterGui:GetCore("TopbarEnabled")", it will make another error saying "GetCore: TopbarEnabled has not yet been registered by the CoreScripts"