I tried making a script where there is a text button that hides your name and health when you click it so others can't see it. I'm pretty sure I did the text button fine because it shows up where I want it and has the right Color. On the other hand I'm not sure what's up with getting your name to hide. When I tested it with my brother It hides the name, but every ones name, Not just the one who clicks on it. I what to know what I can do to fix it, an explanation/advice and what's wrong. here's the script.
Value = Instance.new("BoolValue")
Value.Parent = script.Parent
Value.Value = false
--this is where the textbutton and screengui code is I thought I'd take it out because this part would work
textbutton.MouseButton1Down:connect(function()
if Value.Value == false then
game.Players.LocalPlayer.HealthDisplayDistance = 0
game.Players.LocalPlayer.NameDisplayDistance = 0
textbutton.BackgroundColor3 = Color3.new(255, 45/255, 0/255)
textbutton.Text = "Name Hidden"
Value.Value = true
elseif Value.Value == true then
game.Players.LocalPlayer.HealthDisplayDistance = 100
game.Players.LocalPlayer.NameDisplayDistance = 100
textbutton.BackgroundColor3 = Color3.new(100/255, 255/255, 50/255)
textbutton.Text = "Hide Name"
Value.Value = false
end
end)
-- I think I messed up with LocalPlayer I'm having trouble with the definition of it.
Thank you for reading this I am not great at scripting or Grammar.

1 comment
Thank you for answering my question you were pretty helpful, it took me a while to choose which one answered because I wasn't sure they were working. I'm also glad to know a little more about namedisplaydistance and LocalPlayer. :)