Hi, I’ve been trying for a while to find a way to destroy a value (I don’t think this is the right term but). I made a script (which is below) to create a NameTag except that because of this, the player sees his name in addition to the others (picture). I was advised to destroy the value (thirdtext) with a localscript so that the player doesn’t see his name anymore but still sees the other players’ names. The problem is that I tried a lot of localscripts without success. If someone has an advice or a solution it would be nice. Thanks
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
Clone.Parent = game.Workspace:WaitForChild(plr.Name).Head
local head = char.Head
local newtext = nametag:Clone()
local uppertext = newtext.UpperText
local secondtext = newtext.SecondText
local thirdtext = newtext.ThirdText
local humanoid = char.Humanoid
local wolves = Instance.new("IntValue")
humanoid.DisplayDistanceType = "None"
while wait() do
wolves.Value = plr:WaitForChild("leaderstats"):FindFirstChild("Wolves").value
newtext.Parent = head
newtext.Adornee = head
secondtext.Text = "/90"
uppertext.Text = wolves.Value
thirdtext.Text = plr.Name -- THIS IS WHAT I WOULD LIKE TO DESTROY
if uppertext.Text == "90" then
uppertext.TextColor3 = Color3.fromRGB(49, 153, 26)
secondtext.TextColor3 = Color3.fromRGB(49, 153, 26)
end
end
end)
end)
Try using nametag.PlayerToHideFrom = Player (Replace Player with your LocalPlayer Instance) This should make it disappear for you and for the other Players. (It’ll only hide their Billboards in this case)
Or, If you are running this on a ServerScript, Simply make the PlayerToHideFrom Property the Player that has just joined.
Since your nametag billboard gui is cloned and parented to the character’s head by the server,
you can delete it locally with a localscript
local player = game:GetService("Players").LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local Head = Character:WaitForChild("Head")
Head.newtext.thirdtext:Destroy()
player.CharacterAdded:Connect(function(newcharacter)
Head = newcharacter:WaitForChild("Head")
Head.newtext.thirdtext:Destroy()
end)
Where are you placing the script? You can try to place it in startercharacterscripts so it’s easier to define the character and so you can remove the characteradded event
Unfortunately I can’t make it go away despite my best efforts. I don’t doubt that your script is good, I think I must be doing something wrong. Thank you for your time
Thank you for your answer. Do you know what error I make in this script? The localScript is located in StarterCharacterScripts
local player = game:GetService("Players").LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local Head = Character:WaitForChild("Head")
local rep = game:GetService("ServerStorage")
local nametag = rep.NameTag
local thirdtext = nametag.ThirdText
Head.thirdtext.enabled = false
Isn’t there something I could do in the very first script at the top to make the players’ names visible without having to add them manually? Because even with this addition, the magnification of the names is no longer done when the days are far from each other. So it is difficult to read the names of the players without getting close. While there are basic magnifications and re-sharpenings according to the distance of the players