How can I Hide (not disable) player list?

I have noticed in some games, when you join, the player list is hidden (as if Tab were pressed) but not disabled. However, in my game, when a player joins the player list is open, and they must press Tab to close it.

How are games starting out with the player list closed?

Run on client:

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

Sorry for the misunderstanding, but I do not want to ‘disable’ the player list, only hide it.
That code would disable it.

local StarterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")

local Connection = nil

function SetPlayerList(Enabled)
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, Enabled)
end

SetPlayerList(false)

Connection = UserInputService.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Tab then
		SetPlayerList(true)
		
		Connection:Disconnect()
	end
end)

this is a localscript inside StarterPlayerScripts
basically it disables it when you join and when you press tab it becomes normal again
this is in a localscript so it doesn’t break

Ok, but this seems like more of a workaround. I mean its a great solution, but is there no sort of api that can control the hiding of the player list?

1 Like

not that I currently know of, sorry

I just wonder how that would work for mobile players, considering they don’t have a tab key. :frowning:

oh yea, that code would only work on pc…