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
If you try to print "game.StarterGui:GetCore("TopbarEnabled")", it will throw an error saying "GetCore: TopbarEnabled has not been registered by the CoreScripts"
Looked at parameters of GetCoreGuiEnabled and GetCoreGuiEnabled requries a parameter of Enum.CoreGuiType, so I think that should work...
got a true value with game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.All)
Yeah, so for some reason "TopbarEnabled" isn't there when it should be.
Why not just keep track of the visibility of the Topbar? It's not like anything but the programmer can change it.
The plan is to use the script in multiple games and I don't want to have to change the variable for each place
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"