Disabling the player list

I was trying to achieve a no playerlist script for a roleplay game my friend made and I am a dev for. I found a resource on the devhub and tried it. I used it on my private test game and it worked, so I put it in the actual roleplay game. When I put it there, it wasn’t working, my thought is a script in the game was overlapping with the playerlist script. Here is what it is:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

It is in the StarterGui. I am very confused?

7 Likes

Question. Did you use a local script or a regular script? Are there any errors in the output?

I tested your script from a local script inside starter gui and it worked in both studio and actual game play.

Local script, no errors from the private test game but let me check for the roleplay game.

1 Like

Put it inside starterplayer scripts, that will fix your issue most likely.

1 Like

@HonestJar I checked out the output, nothing related to it in the roleplay game. @ViserLizz I will try that tomorrow as I have to go to sleep right now. Thanks everyone.

2 Likes

Try this, it should work in a LocalScript under StarterGui:

game.StarterGui:SetCoreGuiEnabled("PlayerList",  false)

put it in StarterGui or in StarterCharacterScripts, I suggest StarterGui as StarterCharacterScripts will only run once the character of the player is loaded.

@KJry_s I did. @DaBisawesome123 Local script under startergui is how I did it.

1 Like

I still don’t have a solution, so anyone with any insight, please reply!

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

I tried that too, with out the get service, and it doesn’t work.

1 Like

Are you sure you are using it inside a local script in StarterGui?

Perhaps the script is disabled unknowingly or there is something else affecting the playerlist being enabled in the game? No idea why this would happen unless something else is acting upon the script or the playerlist.

1 Like

That is what I speculated at first. Anything I can do to pinpoint if that is happening?

@vsefu1 absolutely, positively, sure.

1 Like

I don’t know why it’s not working for you, I just tested it and it works.

1 Like

As I said, I tested it in my private test game, works, but when I put it in the actual roleplay game, it doesn’t work.

Let’s try a test where we repeatedly set the playerlist to disabled to see if there’s something enabling it when the game starts:

while wait() do
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end

If it works, then we can confirm our suspicions of something else affecting the playerlist on startup.

5 Likes

Let me try that, and I will get back to you.

EDIT: Do I leave it as a localscript, in StarterGui?

1 Like

Yes it has to be in a local script inside StarterGui.

1 Like

A local script will not work unless it is a descendant of the character or player its client is based on.