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

How to hide own player name tag but other players still can see?

Asked by 7 years ago
game.Players.ChildAdded:connect(function(player)
    player.CharacterAdded:connect(function(char)
        local plyrGui = Instance.new("BillboardGui")
        plyrGui.Parent = char.Head
        plyrGui.Adornee = char.Head
        plyrGui.Size = UDim2.new (1,0,1,0,0,0)
        plyrGui.StudsOffset = Vector3.new (0,2,0)

        game.Workspace:WaitForChild(player.Name):WaitForChild("Humanoid").DisplayDistanceType = "None"      

        local text = Instance.new("TextLabel")
        text.Parent = plyrGui
        text.Text = player.Name
        if not text.TextFits then
            text.TextScaled = true
        end
        text.Font = "SciFi"
        text.FontSize = "Size24"
        text.Size = UDim2.new (1,0,1,0,0,0)
        text.BackgroundTransparency = 1
        text.TextColor3 = BrickColor.new ("White").Color
        text.TextStrokeColor3 = BrickColor.new("Black").Color
        text.TextStrokeTransparency = 0
    end)
end)

1 answer

Log in to vote
0
Answered by 7 years ago

There is a property in the billboard gui called "PlayerToHideFrom". It is an object value. You set this value to the player and the player will notsee their own name tag while other people do.

plyrGui.PlayerToHideFrom = player

If this answered your question be sure to confirm it.

0
yea that's the bestest Rawblocky 217 — 7y
0
Thank you it works :) . I didn't realize that properties. Thanks again! xiFrosty 13 — 7y
0
No problem! QuantumToast 261 — 7y
Ad

Answer this question