✓ Accepted answer
i'm assuming that you're talking about the client hiding everyone else's names. To do this first we need to turn on FilteringEnabled, then we will create a localscript to run on the client.
Inside the localscript we will use a for loop to run through each player and hide their nametag
for _,v in pairs(game.Players:GetChildren()) do
v.HealthDisplayDistance=0
v.NameDisplayDistance=0
end
Next let's add this to your script. I'm going to combine where you call the script and where its ran
local hid = false
script.Parent.MouseButton1Click:connect(function()
if hid == false then
game.Players.LocalPlayer.HealthDisplayDistance = 0 game.Players.LocalPlayer.NameDisplayDistance = 0
script.Parent.Text = "Hide Name"
hid = true
elseif hid == true then
game.Players.LocalPlayer.HealthDisplayDistance = 100 game.Players.LocalPlayer.NameDisplayDistance = 100
script.Parent.Text = "Show Name"
hid = false
end
end)
Let' change the part where it hides the nametags
local hid = false
script.Parent.MouseButton1Click:connect(function()
if hid == false then
for _,v in pairs(game.Players:GetChildren()) do
v.HealthDisplayDistance=0
v.NameDisplayDistance=0
end
script.Parent.Text = "Hide Name"
hid = true
elseif hid == true then
for _,v in pairs(game.Players:GetChildren()) do
v.HealthDisplayDistance=100
v.NameDisplayDistance=100
end
script.Parent.Text = "Show Name"
hid = false
end
end)
So remember, make sure filteringenabled is one and this is a localscript
2 comments
lol i was confused on what he was talking about
Thanks this worked great