Unbinding Context Action Service From The Player List Leaderboard CoreGUI

Hello developers. I am working on an inventory system where I need to press Tab to both open and close an inventory GUI. The inventory system works perfectly however it is also opening and closing the leaderboard(player list) when the Tab button is pressed. I absolutely DO NOT want to remove the leaderboard core GUI as I need it for my game. My question is, is there a way to unbind it so that the leaderboard GUI is always out?

My Code;

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

local player = game.Players.LocalPlayer
local gui = script.Parent
local cas = game:GetService("ContextActionService")

local IsOpen = false

function OpenAndClose ()
	if IsOpen == true then IsOpen = false else IsOpen = true end
	gui:FindFirstChild("MainFrame").Visible = IsOpen
end


cas:BindAction("OpenClose", OpenAndClose, true, Enum.KeyCode.Tab)

Here is a Gyazo gif of the problem : Link

Are you using UserInPutService? If so, the function when using .InputBegan has a second argument which determines if there is any gui [chat,leaderboard,etc] opening.

Also, mind showing us the code?

yes just put

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

in local script in starter gui

He doesnt want to remove the player list.

No, I am using CAS because I need to make my UI accessible to mobile users.

1 Like

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

local player = game.Players.LocalPlayer

local gui = script.Parent

local cas = game:GetService("ContextActionService")

local IsOpen = false

function OpenAndClose ()

if IsOpen == true then IsOpen = false else IsOpen = true end

gui:FindFirstChild("MainFrame").Visible = IsOpen

end

cas:BindAction("OpenClose", OpenAndClose, true, Enum.KeyCode.Tab)```

Bind the inventory system to a different key, the core backpack gui uses the backtick ‘`’ character.