Problem with disabling core functionalities

Hi, i’m making a test game Using ACS (Advanced Cosmbat System) and i wanted to set a custom backpack, so i disabled Default Backpack (and PlayerList too). The problem is when a player lose life the default backpack returns (and not the PlayerList).

Is this a problem caused by ACS?

	wait(.5)

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

Well firstly, I suggest you get the service first and then set the core gui like this:

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

And secondly, for the backpack core gui, you did it wrong. The first parameter is supposed to be an Enum value, not a string. I fixed it up for you.

It does the same thing as before, as i take damage the default backpack shows, It’s not a problem of the custom one cause i tried with some toolbox ones. I could do it with a really shorter loop than 0.5 but i beware the performance

Is this a local script? And where is it located?

It’s a localscript in starterGUI

I don’t think StarterGui is quite suitable for scripts but eh, if it works, it works. Well… Maybe another script is tampering with the CoreGui?? You could also just put the script inside ReplicatedFirst.

I think some ACS script is tempering with CoreGUI but how do i know what is the script that is cousing problems? Also i put it in RepFirst but doesn’t work

Well then, check all of your scripts and see if any scripts are disabling or reenabling any CoreGui. Another option is to wrap the :SetCoreEnabled in a pcall() function but I think another script is messing around.

local StarterGui = game:GetService("StarterGui")

local success, errorMessage = pcall(function()
    StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
    StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
end)

if success then
    print("No errors were logged.")
else
    warn("Error was detected!")
    warn(errorMessage)
end

You could also just continuously disable the core guis but that might harm performance.

In the ACS medical client script it contains

function onChanged()
if (SKP_17.Value <= 3500) or (SKP_18.Value >= 200) or SKP_15:GetAttribute(“Collapsed”) then
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
SKP_25:UnequipTools()
SKP_26:FireServer()
elseif (SKP_17.Value > 3500) and (SKP_18.Value < 200) and not SKP_15:GetAttribute(“Collapsed”) then – YAY A MEDIC ARRIVED! =D
SKP_26:FireServer()
if not SKP_15:GetAttribute(“Surrender”) then
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end
end

onChanged()

SKP_17.Changed:Connect(onChanged)
SKP_18.Changed:Connect(onChanged)

SKP_15:GetAttributeChangedSignal(“Surrender”):Connect(function()
local Valor = SKP_15:GetAttribute(“Surrender”)
if Valor == true then
SKP_25:UnequipTools()
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
else
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end)

This basically turns off the backpack UI and turns it back on each time you collapse

if you want to keep the UI off just go to the MedSys_FX and change all the backpack True to False

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.