Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why Won't My CoreGui's Re-Appear?

I used this code to disable all the CoreGUI's, disable the TopBar, and disable Reset.

local starterGui = game:GetService("StarterGui")

pcall(function()
	starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
	starterGui:SetCore("ResetButtonCallback",false)
	starterGui:SetCore("TopbarEnabled",false)
end)

and it works, but after my preloading system is done, I try to get the GUI's back and the reset button comes back enabled, but the GUI's don't come back up.

pcall(function()
	starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
	starterGui:SetCore("ResetButtonCallback",true)
end)

This is in a LocalScript in ReplicatedFirst

Full Code:

--// Game Setup
game:GetService("ReplicatedFirst"):RemoveDefaultLoadingScreen()
local cp = game:GetService("ContentProvider")

--// Player Setup
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local starterGui = game:GetService("StarterGui")

pcall(function()
	starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
	starterGui:SetCore("ResetButtonCallback",false)
	starterGui:SetCore("TopbarEnabled",false)
end)

--// Extra Setup
local ui = script:WaitForChild("LoadingGUI")
ui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local blur = Instance.new("BlurEffect", game:GetService("Workspace").CurrentCamera)
blur.Name = "Blur"

--// UI Variables
local BR = ui.Holder.BottomRight
local BL = ui.Holder.BottomLeft
local TR = ui.Holder.TopRight
local TL = ui.Holder.TopLeft
local BF = ui.Holder.BackgroundFrame
local LL = ui.Holder.LoadingLabel
local TT = ui.Holder.TimeTaken

--// Configuration
local optionalAssets = {}
local disabledServices = {
	-- Ex ["Lighting"] = false;
} -- Services Not To Preload

--// Preload
warn("Starting Preload")
local startTick = tick()

BR:TweenSize(UDim2.new(0.5,0,0.5,0),"Out","Linear",1,true)
BL:TweenSize(UDim2.new(0.5,0,0.5,0),"Out","Linear",1,true)
TR:TweenSize(UDim2.new(0.5,0,0.5,0),"Out","Linear",1,true)
TL:TweenSize(UDim2.new(0.5,0,0.5,0),"Out","Linear",1,true)
wait(1)
LL:TweenSize(UDim2.new(0.15,0,0.07,0),"Out","Linear",1,true)
BF:TweenSize(UDim2.new(0.15,0,0.07,0),"Out","Linear",1,true)
TT:TweenSize(UDim2.new(0.15,0,0.1,0),"Out","Linear",1,true)

--Preload Optional Assets First
cp:PreloadAsync(optionalAssets)

-- Preload The Entire Game
for i,service in pairs(game:GetChildren()) do
	pcall(function()
		if not disabledServices[service.Name] then
			cp:PreloadAsync({service})
		end
	end)
end

--// Ends Preload And Clears Everything (Fixing Everything)
warn("Preload Done, Time Taken: "..string.sub(tick()-startTick, 1, 5).."s")
LL.Text = "Loaded"
TT.Text = "Time Taken: "..string.sub(tick() - startTick, 1, 5).."s\nIf Time Exceeds 30s Please\nReport It To The Developers"
wait(2.5)
LL:TweenSize(UDim2.new(0,0,0.07,0),"Out","Linear",1,true)
BF:TweenSize(UDim2.new(0,0,0.07,0),"Out","Linear",1,true)
TT:TweenSize(UDim2.new(0,0,0.1,0),"Out","Linear",1,true)
wait(1)
BR:TweenSize(UDim2.new(0,0,0,0),"Out","Linear",1,true)
BL:TweenSize(UDim2.new(0,0,0,0),"Out","Linear",1,true)
TR:TweenSize(UDim2.new(0,0,0,0),"Out","Linear",1,true)
TL:TweenSize(UDim2.new(0,0,0,0),"Out","Linear",1,true)
wait(1)
for i = 24,0,-1 do
	blur.Size = i
	wait()
end
wait()
pcall(function()
	starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
	starterGui:SetCore("ResetButtonCallback",true)
end)
wait(1)
ui:Destroy()

Any help?

1 answer

✓ Accepted answer

It appears here your disabling with the all coreguitype,

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

but then after pre-loading finishes your doing

starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
starterGui:SetCore("ResetButtonCallback",true)

that isn't enabling all, thats just enabling the resetbutton and playerlist. If you change it to Enum.CoreGuiType.All it might fix the problem. and it also appears that you aren't enabling topbar back so you might want to add starterGui:SetCore("TopbarEnabled",true) too.

1 comment

0

Thanks, it wouldn't come back unless I had starterGui:SetCore("TopbarEnabled",true).

This discussion is preserved as it was. New answers, comments, and votes are closed.