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

[SOLVED] How can i make this script affect only the Player's Humanoid instead of all humanoids?

Asked by 4 years ago
Edited 4 years ago

So the script below hides the player's name.. However i have some NPC/Parts with Humanoids that get their name hidden aswell....I only want to hide it for the players, what should i do?

local billboardgui = game:GetService("ServerStorage"):WaitForChild("GUIs"):WaitForChild("PlayerNameGui")


game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)

        char.Humanoid.NameDisplayDistance = 0

        local clonedgui = billboardgui:Clone()
        clonedgui.Parent = game.Workspace:WaitForChild(plr.Name).Head
        clonedgui.TextLabel.Text = plr.Name
    end)
end)
0
I'm going to tell you right now that that is already only going to affect players, not NPCs. davidgingerich 603 — 4y
0
Nope, this script does something to the parts with humanoid...apparently the Humanoid still has the normal displaydistance but it simply doesn't show the name. Any ideas? ady1111 8 — 4y
0
Hmm...It seems NameDisplayDistance affects the player but makes him unable to see any other humanoids names..Is there any other way to hide the player's name? ady1111 8 — 4y
0
set display distance type to None Luka_Gaming07 534 — 4y
0
Thanks Luka, Working well now! I just changed Player's DistanceType to None and made the distance back to the normal value.  ady1111 8 — 4y

Answer this question