So, I have a start screen that has a play button, is there a way to disable the Roblox toolbar and leaderboard until the play button is pushed?
With the leaderboard you should be able to via Script, for the Roblox toolbar, I’m not so sure.
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
Disables every roblox UI
Insert a LocalScript
somewhere inside 1 of the client services:
local StarterGui = game:GetService("StarterGui")
local Button = script.Parent
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
Button.MouseButton1Click:Connect(function()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
end)
I believe you can use SetCoreGuiEnabled
to disable certain ui elements, and using SetCore("TopbarEnabled",false)
should disable the topbar, remember these are StarterGui methods
local StarterGui = game:GetService("StarterGui")
local Button = script.Parent
StarterGui:SetCore("TopbarEnabled",false)
Button.MouseButton1Click:Connect(function()
StarterGui:SetCore("TopbarEnabled",true)
end)
You don’t need to use SetCoreGuiEnabled
if you disable the topbar, as that it’ll do it for you
I tried this, it seems to work but when my UI resets your character, it gets rid of the UI again. How would I fix this? Here is a recording below. I will also include an image of where I put your script.
Image:
Recording:
This is probably because the PlayerGui
seems to reset every Instance that’s parented inside?
Try parenting the script to where your Button
is supposed to be (Or create another ScreenGui
and place it there), if the ResetOnSpawn
property is set to false on the Gui Object then it should work
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("TopbarEnabled", false)
local StartGui = PlayerGui:WaitForChild("StartScreen").Main
StartGui.Background.PlayButton.MouseButton1Click:Connect(function()
StarterGui:SetCore("TopbarEnabled", true)
end)
Do you mean I should put the localscript inside of my screen GUI?
If the ResetOnSpawn
property is set to false, yes
Otherwise just create a new ScreenGui
, set that property to false, and that’ll temporary hold the LocalScript
there (Hopefully)
Thanks for the help, this works.
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
Set to true
when it shall come back.
It’s just a temporary solution until we can figure out why the script keeps resetting for some random reason I suppose, so np
Also @ItsNickBoi110 You’re kinda a bit late but okay