generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Hiding the Top Bar

Previous Thread :: Next Thread 
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Sep 2016 01:31 PM
This works, but I'd like to do away with the wait(2) at the beginning.
If there's no wait, it won't disable the top bar (with the exception of PlayTest)

Also, should this be run from a local or server script?

wait(2)
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", false)
end)


Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
06 Sep 2016 01:34 PM
It's probably not loaded yet when the script runs
Try waiting for player to load, then remove it?
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
06 Sep 2016 01:37 PM
wait(.3)
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", false)
end)




Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Sep 2016 01:43 PM
@L2k: How can I determine when the player is fully loaded? Does this include the Character?
This will be a 1 player game.

@Wowgnomes: Why 0.3?


Report Abuse
Xsitsu is not online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
06 Sep 2016 01:46 PM
There is a wait() in the core script that registers that function, so you will NEED to wait a frame before disabling it. The absolute fastest you could get would be something like this.

while not pcall(TRY DISABLE) do
RunService.RenderStepped:wait()
end
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Sep 2016 01:53 PM
Thanks Xsitsu, This worked for me:

while not
pcall(function()
local starterGui = game:GetService('StarterGui')
starterGui:SetCore("TopbarEnabled", false)
end)
do
game:GetService("RunService").RenderStepped:wait()
end



Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
06 Sep 2016 02:21 PM
@Soy

I disabled it just fine in my game without a wait- or a pcall for that matter. I believe that article is outdated.


I can C-Sharply, can you?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Sep 2016 02:22 PM
With what code?


Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
06 Sep 2016 02:23 PM
I just do this

local StarterGui = game:GetService("StarterGui")

StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
StarterGui:SetCore("TopbarEnabled", false)


I can C-Sharply, can you?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Sep 2016 02:24 PM
I'll try that

Why do you say local StarterGui = and not just StarterGui = ?
just curious


Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
06 Sep 2016 02:25 PM
Local variables are faster, and global variables should be used sparingly.
I'm no expert coder though, I'd ask someone like Flux for specifics.


I can C-Sharply, can you?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Sep 2016 02:25 PM
Also just doing that, without the pcall, gave this error

local StarterGui = game:GetService('StarterGui')
StarterGui:SetCore("TopbarEnabled", false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

15:24:55.507 - SetCore: TopbarEnabled has not been registered by the CoreScripts
15:24:55.507 - Stack Begin
15:24:55.508 - Script 'Players.Player1.PlayerGui.IntroGui.Setup', Line 2
15:24:55.508 - Stack End


Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
06 Sep 2016 02:26 PM
Weird. I don't get that error. O.o.


I can C-Sharply, can you?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Sep 2016 02:28 PM
I put a wait() before it, remembering the example and what Xsitsu mentioned about it all being loaded after a wait() in the core scripts.
Just tested in a real server and it works too.

https://www.roblox.com/games/490723399/Fractal
Thanks guys! :)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image