Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a person's nametag invisible?(unanswered)

I would like to have use a script making the nametags/health on all the people on the blue team not visible. Here is the script I used.

for i,v in pairs(game.Players:GetPlayers()) do
	if v.TeamColor == BrickColor.new("Bright blue") then	
		v.HealthDisplayDistance = 0
			v.NameDisplayDistance = 0
	end
end

Thanks

1 answer

Oops. Try this:

for i,v in pairs(game.Players:GetPlayers()) do
    if v.TeamColor ~= BrickColor.new("Bright blue") then    
        v.Character:WaitForChild("Humanoid").NameOcclusion = Enum.NameOcclusion.EnemyOcclusion

    end
end

This Will only work if there are only two teams. This code should Hide the names of anyone who is on the Bright blue Team.

This discussion is preserved as it was. New answers, comments, and votes are closed.