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)
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.
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)```