Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago
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.

0
The 'PlayerAdded' event line does not support within a 'LocalScript', or, is not supported in a Client-Sided script. TheeDeathCaster 2368 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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.

0
Thanks Senor_Chung 210 — 9y
Ad

Answer this question