Disabling the player list

So should I put it in the workspace, in a script?

No, it must be inside the player or character (doesn’t need to directly be the child, though.) StarterGui will work fine since that puts the script inside the PlayerGui (which is inside the client’s player) when the game starts.

1 Like

Okay, so in StarterGui, and a normal script?

1 Like

A local script within StarterGui like you first used will work fine.

1 Like

YES! It works, so it must be a script preventing it from happening. Thank you so much! Should I leave it as is, or should I try to find the cause?

You should try and find the cause in the other local scripts of the game, it’d be a lot better to be able to just set it once and be done with it than have to do it multiple times. No problem, man.

1 Like

Would there be any performance/any other consequences of leaving it as is?

1 Like

The performance consequences are incredibly slight I’m pretty sure, you should be more worried about its efficiency and how this will affect managing the game later on. If you tried to edit the player list somewhere else down the line, you might forget about this and end up starting the problem all over again and confusing yourself.
It’s really important to generally just have efficient code that works in the long run.

1 Like

Using while wait() is a bad practise.
You should get RunService and use .Stepped:Wait().

Example:

local RunService = game:GetService("RunService")

while true do
  local StarterGui = game:GetService("StarterGui")
  StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
  RunService.Stepped:Wait()
end

Using while wait() do really isn’t bad at all. Using RunService.Stepped:Wait() just bases your loop on the framerate of the client and isn’t all that helpful in this situation.

2 Likes

Regardless though, that code is merely for testing and as I was saying shouldn’t be used as an actual solution.

1 Like

You could use a pcall too and check if the change failed, run it again.

There really isn’t a point to augmenting that code any further as it’s a temporary solution and was used to test whether something else was affecting the playerlist being enabled or not. Sorry for not clarifying.