What do you want to achieve? I want to keep the CoreGui Backpack type disabled.
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
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.
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.
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
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
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)
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.