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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 06 Sep 2016 02:26 PM |
Weird. I don't get that error. O.o.
I can C-Sharply, can you? |
|
|
| Report Abuse |
|
|
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 |
|
|