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.