I am trying to disable the player list from view, but it isn’t working. I placed a LocalScript in the StarterGui, with the following code:
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("ResetButtonCallback", false)
StarterGui:SetCore(Enum.CoreGuiType.PlayerList, false)
This has apparently resulted in this error: [22:48:38.209 - SetCore: PlayerList has not been registered by the CoreScripts]
Does anyone know how to fix this? Please let me know, thank you!
You must yield before using this command. Roblox takes a while to set up setCore sometimes.
Try this, as it can also error sometimes:
local s = false --Success
local StarterGui = game:GetService("StarterGui")
repeat
s = pcall(function()
StarterGui:SetCore("ResetButtonCallback", false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end)
wait()
until s
Explanation
Since it takes time to set setcore up, it may error when you call it before then. Call it about every few frames to see if it is set up.
Also, it is setCoreGui enabled, not setcore for the playerlist.
This is only the case with ReplicatedFirst scripts because they run earlier than some CoreScripts. LocalScripts replicated to the player after Loaded fires already have CoreScripts loaded. pcalling becomes unnecessary at this point.