Hiding players name but not health

how would i hide the player’s name without hiding the health bar when a player gets damaged?

something like this:
image

1 Like

Either put this in StarterCharacter scripts or use another script to get this script into the player’s character.

humanoid = script.Parent:WaitForChild("Humanoid")

humanoid.Changed:Connect(function(value)
	if humanoid.Health < 100 then
		humanoid.DisplayName = " "
	else
		humanoid.DisplayName = script.Parent.Name
	end
end)

can’t it be done without using scripts?

isnt there like a property to enable it??

You can place this in the command bar

workspace.Dummy.Humanoid.DisplayName = " "

only change the location of the humanoid, and no, it seems that there is no function for this.

3 Likes
_HUMANOID.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None

https://developer.roblox.com/en-us/api-reference/property/Humanoid/DisplayDistanceType

Is the correct solution as the previous user pointed out, this way you’ll still be able to name the character models of which your humanoid instances belong to (without them being displayed as name tags).

If you still want the health tag to be displayed then you could instead use the following property.

https://developer.roblox.com/en-us/api-reference/property/Humanoid/NameDisplayDistance

There is a problem, the creator of the post wanted the health bar to be seen without the name, what you propose and @puofz hides both things.


Well I just tested & it seems like the solution I proposed works.

This was the result of each humanoid receiving damage and having their “NameDisplayDistance” property set to 0.

The benefit of this is that it disregards the humanoid’s character model’s name (you don’t need to name the model a single whitespace).

It doesn’t seem to work



That’s because you’re using an NPC’s character model and not a player’s character model. Switch its “DisplayDistanceType” property to subject not viewer.

1 Like

image

Same model you’re using.

Well, it seems to work, but honestly the solution I gave is easier, it’s just one line.

You can’t set a player’s character’s name to " ", it’ll revert back to its previous state immediately.

https://gyazo.com/8f0703d175b5535ff5b523d271b58856

1 Like

That’s why it’s done in the command bar, it forces studio to do it, and it’s up to the creator of the post which post he chooses as a solution.

You can’t use the command bar in real-time to change a player’s character’s name though. You can’t even script it either. Take the following example for instance.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAppearanceLoaded:Connect(function(character)
		character.Name = " " --name isnt set
	end)
end)

and it’s up to the creator of the post which post he chooses as a solution.

Not sure how this is relevant, no one has suggested that someone else should be given the solution mark.

3 Likes