Disabling CoreGui Backpack

  1. What do you want to achieve? I want to keep the CoreGui Backpack type disabled.

  2. What is the issue? I attempt to pcall the backpack away using this:

local StarterGui = game:GetService("StarterGui")

local success, errors = pcall(function()
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
end)
if not success then
	print(errors)
end

I also tried putting

game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

at the beginning of my script and that did not work either.

The Backpack gui will come back immediately after gaining a tool in the inventory. When I try to disable it in the command bar it also comes back immediately. That is also the only script where I disable the backpack.

  1. What solutions have you tried so far? I looked around on the devforum and could not find anything related to my issue. I asked on a scripting assistance discord server and no one replied.

I need to keep the backpack disabled for my custom hotbar/inventory system and it keeps coming back no matter what I try.

2 Likes

Make sure this is running on a localscript, and The parent of it is StarterGui or either StarterPlayerScripts.

The parent is in StarterPlayerScripts and it still came back.

It still wonā€™t function? Thatā€™s the point?

Yes, the Backpack is meant to disable and not come back. However, when I add a tool to my backpack, the Backpack re-appears.

local StarterGui = game:GetService("StarterGui")

local success, errors = pcall(function()
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
end)
if not success then
	print(errors)
end

(In StarterPlayerScripts)

Ok, the only thing you did wrong was use (ā€˜StarterGuiā€™) it must be (ā€œStarterGuiā€).

  • Hereā€™s an Example
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
1 Like

This still did not work. (need more chars)

Perhaps youā€™re studio glitched, because this is the main function to disable the backpackā€¦

Maybe you should try restarting studio?

Is there anything that could be interfering with this function?

Quotations using ā€™ or " should not matter. These syntaxes function the same in identifying a string.

@H34E7R Are you using a local script?
image

Hereā€™s a test place that I made for you:
Test.rbxl (28.3 KB)
Seems to function here.

1 Like

Yes it is a local script. Is there anything that could be interfering with this script?

You donā€™t need to use pcall function, and just place the local script in the StarterPack or StarterGui , the reason is the parent of your local script, StarterPlayerScript wonā€™t reset after death. So remove the pcall function and parent your local script in StarterGui

game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

This is in a script inside StarterGui with my inventory/hotbar system.
I tried making a script with only that line and the backpack still came back.

Hmmm, would you mind trying my place out?

If the error doesnā€™t persist there, then it could be a local script in your game that is consistently setting the backpack gui to true.

If the error does persist in there, then Iā€™m thinking it could either be a studio problem, or a script in the tool is controlling your gui (which I HIGHLY doubt)

Have you checked any other scripts, some of them may set the Backpack to true

The issue is non-persistent.
image

The only place where I set the backpack. I have no idea what could be interfering however.

1 Like

Can you have a video about it ?

It might take me a little bit to make one.

1 Like

That is really weird. I have another test for you.

In your local script, try typing this:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

local start = tick()
game:GetService("RunService").Heartbeat:Connect(function()
	if tick() - start > 0.5 then
		start = tick()
		print(StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))
	end
end)

This basically prints the status of your backpack gui every 0.5 seconds. Check to see what the output consistently prints.

This is interesting. It is printing true every .5 seconds.

It printed false for 2 seconds and then printed true

1 Like