Hiding PlayerList without Disabling It?

I have a game that puts up a HUD while the player is racing, including a lap counter in the upper-right corner. I would like to hide the PlayerList while the player is racing, but allow them to hit Tab if they want to show/hide the PlayerList mid-race.

Currently, the only way I have found to hide the PlayerList is to disable it with StarterGui:

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

… but that completely removes it from the top menu and Tab then does nothing until the PlayerList is re-enabled. I suppose could listen myself for Tab while the PlayerList is disabled, but that seems heavy-handed. Is there any way to more gently “hide” the PlayerList and still allow the default Tab functionality?

8 Likes

Would it matter to just let it be there and let the player press tab to put it away? Otherwise, go to test game, switch from client to server, and find the gui of the leaderboard, then put it to invisible, after doing that, make a script in serverscriptservice that switches the visibility of the leaderboard when the player presses tab.

3 Likes

This sounds possible. My problems with it are not that it won’t work, but:

  1. It is brittle. If I am grabbing a handle to an object that might someday change its name or position in the object hierarchy, future breakage could sneak up on me.
  2. It wouldn’t do the cool animation in and out unless I rewrote all of that too.

Because the CoreUI only recently changed it is possible that not everyone is aware that Tab does the thing. It is an aesthetic choice, but I’d rather not have a new player see overlapping UI elements if I can help it.

2 Likes