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

I'm trying to hide a players name. Why isn't it working?

game.Players.PlayerAdded:connect(function()
	game.Players.LocalPlayer.HealthDisplayDistance = 0
	game.Players.LocalPlayer.NameDisplayDistance = 0
end)

There are no errors in the output, and I've tried testing it with this

http://i.gyazo.com/a67794280de873f0d08f4a7f4aadea3e.png

but the names still show.

1 comment

0

The 'PlayerAdded' event line does not support within a 'LocalScript', or, is not supported in a Client-Sided script.

1 answer

✓ Accepted answer

Is this in a Script or LocalScript?

There is one basic way to hide the name, which is to set the properties associated with the Player to 0.

These two properties are

HealthDisplayDistance

along with

NameDisplayDistance

For a script, you'd do this:

game.Players.PlayerAdded:connect(function(p)
    p.HealthDisplayDistance = 0
    p.NameDisplayDistance = 0
end)

And in a localscript:

local plr = game.Players.LocalPlayer
plr.HealthDisplayDistance = 0
plr.NameDisplayDistance = 0

This is because you can't use PlayerAdded and LocalPlayer in the same script.

1 comment

0

Thanks

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