It is currently impossible to disable DisplayNames from various elements of the CoreGui. My proposal is a property with the value Players.UseDisplayName
, Roblox’s modules for both the player list and escape menu have a module that is dedicated to this specific function. It would be very easy to add a simple check in the middle.
Ammended RobloxGui.Modules.PlayerList.IsDisplayNameEnabled
local Players = game:GetService("Players")
local FFlagPlayerListUseDisplayName = game:DefineFastFlag("PlayerListUseDisplayName", false)
local FFlagPlayerListUseDisplayNameChina = game:DefineFastFlag("PlayerListUseDisplayNameChina", false)
local FFlagPlayerListUseDisplayNameChina2 = game:DefineFastFlag("PlayerListUseDisplayNameChina2", false)
local DeveloperEnabledDisplayNames = Players.UseDisplayName
local function isDisplayNameEnabled(subjectToChinaPolicies)
if not DeveloperEnabledDisplayNames then
return false
end
if FFlagPlayerListUseDisplayName then
return true
end
if FFlagPlayerListUseDisplayNameChina2 then
return subjectToChinaPolicies
end
if FFlagPlayerListUseDisplayNameChina then
return subjectToChinaPolicies
end
return false
end
return isDisplayNameEnabled
Ammended RobloxGui.Modules.Settings.UsePlayerDisplayName
local CoreGui = game:GetService("CoreGui")
local RobloxGui = CoreGui:WaitForChild("RobloxGui")
local Players = game:GetService("Players")
local PolicyService = require(RobloxGui.Modules.Common.PolicyService)
local FFlagOldInGameMenuDisplayNameForAll = game:DefineFastFlag("OldInGameMenuDisplayNameForAll3", false)
local FFlagOldInGameMenuDisplayNamePolicy = game:DefineFastFlag("OldInGameMenuDisplayNamePolicy3", false)
local DeveloperEnabledDisplayNames = Players.UseDisplayName
local function UsePlayerDisplayName()
if not DeveloperEnabledDisplayNames then
return false
end
if FFlagOldInGameMenuDisplayNameForAll then
return true
end
if FFlagOldInGameMenuDisplayNamePolicy then
return PolicyService:IsSubjectToChinaPolicies()
end
return false
end
return UsePlayerDisplayName```
This is about 8 extra lines in the Core GUI Modules, and yet Roblox have appeared to have completely disregarded the issue that some developers might just not want them on. The Chat appears to already be disableable through a setting (thank god)
ChatSettings Line 94-98
--[[ Display Names ]]
--Uses DisplayNames instead of UserNames in chat messages
module.PlayerDisplayNamesEnabled = false
--Allows users to do /w displayName along with /w userName, only works if PlayerDisplayNamesEnabled is 'true'
module.WhisperByDisplayName = false
Finally, for Humanoids themselves, you can use this
local Humanoid = script.Parent:WaitForChild("Humanoid")
Humanoid.DisplayName = ""