Hello everyone, today I modernized the backpack by creating another one, only the old backpack preset by roblox overlaps the new one. So I searched a bit on youtube how to disable it and I came up with this string of code to put in a “local script” in the “startergui”.
local StarterGui = game: GetService (“StarterGui”)
game.StarterGui: SetCoreGuiEnabled (Enum.CoreGuiType.Backpack, false)
The problem is that when I enter the game it doesn’t work and the backpack appears anyway, can you help me? thank you all
Sometimes directly doing this might not work, so there’s a better approach:
local coreCall do
local MAX_RETRIES = 7
local StarterGui = game:GetService('StarterGui')
local RunService = game:GetService('RunService')
function coreCall(method, ...)
local result = {}
for retries = 1, MAX_RETRIES do
result = {pcall(StarterGui[method], StarterGui, ...)}
if result[1] then
break
end
RunService.Stepped:Wait()
end
return unpack(result)
end
end
coreCall('SetCoreGuiEnabled', Enum.CoreGuiType.Backpack, false)
Note: Essentially what this code does is try disabling the backpack UI until it runs out of tries (you defined in MAX_RETRIES) or when it’s successful (no errors returned)
Important: Make sure this is a Local Script, and it’s in a place where it will be executed when a player joins a server of your game.
place the local script inside ReplicatedFirst, if you already got the solution mark a solution or you have solved it say how you solved it and mark it as the solution
Im 99% sure you have some other script enabling the backpack every frame, check your other scripts that you think might be doing this, I had this same problem.
I’m having the same exact issue, I recently tested a backpack ui system and it works in other studios but not the studio I want. Is there any specific way to check for a script interfering?
You could loop through every script in the game and check if the script’s source contains “:SetCoreGuiEnabled”. If it does, you can check the script and see if it is enabling the backpack.
for i, v in game:GetDescendants() do -- You dont have to loop through the whole game, you could loop through one service at a time.
if v:IsA("Script") or v:IsA("LocalScript") or v:IsA("ModuleScript") then
local source = v.Source
if v.Source:find(":SetCoreGuiEnabled") then
print(v)
end
end
end
local StarterGUI = game:GetService("StarterGui")
StarterGUI:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
wait(1)
print(StarterGUI:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))
I put print(StarterGUI:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) there for debugging, if this doesn’t work and it prints out “True” then there should be a script keeping this on True.
If u are getting any error, do u mind sharing the error you’re getting? Thanks