Bear23913
(BearBoi)
January 3, 2022, 8:34pm
#1
Hello Developers, I am trying to make a script that disables display names, here is the script I have so far, it doesnt work, and I am not sure why.
local plr = game:GetService("Players").LocalPlayer
local Player = game.Players.LocalPlayer
plr.PlayerAdded:Connect(function()
Player.DisplayName = Player.Name
end)
Edit: Out put is saying that "Player Added is not a vaild member of PLayer “Players.Bear23913”
How am I able to fix this?
1 Like
Plr points to the local player, not the player service.
Aeplexi
(Aep)
January 3, 2022, 8:37pm
#3
There is no way to disable display names on the leaderboard. There is a way to disable it on the character’s head though.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
task.wait()
character:WaitForChild('Humanoid').DisplayName = player.Name
end)
end)
Bear23913
(BearBoi)
January 3, 2022, 8:37pm
#4
What do you mean by that sorry?
Bear23913
(BearBoi)
January 3, 2022, 8:38pm
#5
Thank you so very, much does this go in a script in server script or in starter player script in a local script?
Aeplexi
(Aep)
January 3, 2022, 8:38pm
#6
You are trying to use playeradded on a player Instance. game.Players.PlayerAdded
is the correct way to do it.
Aeplexi
(Aep)
January 3, 2022, 8:38pm
#7
This script will go in a server script, if it doesn’t work reply here and I’ll help.
nicemike40
(nicemike40)
January 3, 2022, 8:39pm
#8
There’s actually no scripting required for this: Humanoid | Roblox Creator Documentation
When a Humanoid named StarterHumanoid
is parented to StarterPlayer , … [t]he engine will only override the DisplayName
property of the Humanoid with the DisplayName
property of the player if the StarterHumanoid
’s DisplayName
property is an empty string.
In other words
Stick a Humanoid inside StarterPlayer
Name it “StarterHumanoid”
Set its “DisplayName” to an empty string
4 Likes
Was a typo, I fixed it now. But basically what @Aeplexi said.
Aeplexi
(Aep)
January 3, 2022, 8:40pm
#10
Wow, I didn’t know that! My method still works though, but yours is better.
Bear23913
(BearBoi)
January 3, 2022, 8:40pm
#11
Thank you very much, both of you for solutions to this problem!
Aeplexi
(Aep)
January 3, 2022, 8:41pm
#12
You’re welcome! It’s also possible to disable display names in chat if you’re wondering about that, or if you already did that.
Dehspair
(kanyewestfan911)
October 10, 2023, 11:51pm
#13
If you’re still available, how would I go about doing this? I’m able to disable display names on the leaderboard but unsure how to do so for the chat.
Just for anyone still trying to use this method but not working. You need to set the DisplayDistanceType
to None
. This will then work.
Hope this helps.