Player Head Tag Won't Go Invisible

Hello there fellow developers. I am trying to make a script that hides an above head name tag that is given out to allow players. Everyone can see everyone’s tag as well as their own. However, when I try to use a remote event and local script to pick it up, it does not make my above head name tag go invisible. As some useful information, NameTag is the surface gui and Label is the TextLabel under the SurfaceGui that actually shows your nametag. Any help here is greatly appreciated!

ServerSide Script:

game.ReplicatedStorage.Interactions.Client.HideHeadTag:FireAllClients(game.Players:GetPlayerFromCharacter(tool.Parent.Name))

StarterPlayerLocalScript:

local plr = game.Players.LocalPlayer

game.ReplicatedStorage.Interactions.Client.HideHeadTag.OnClientEvent:Connect(function(plrtohide)
	for _, player in pairs(game.Players:GetChildren()) do
		if player.Name == plrtohide then
			player.Character.Head.NameTag.Label.Visible = false
		end
	end
end)

Note: I have no errors.

1 Like

This might be of help: I noticed NPCs have a property in the “Humanoid” object called DisplayDistanceType. If you set it to none, their name goes away.

I mean you’re sending the player instance, then why not just put if player.Name == plrtohide.Name then instead? Might just be me, but I think that should be necessary. Oh yeah, check if the character is loaded first (in the for loop). Also I’d rather disable the BillboardGui itself, but that’s just me.

1 Like

Disabling the BillboardGui might work, actually. Good thinking!

1 Like

That does not work. Remember, this is a custom surfacegui that is under the players head that everyone sees. Also, the founder or our other developer set the distance already to 0 because we are using custom as you know.

1 Like