local player = game.Players.LocalPlayer local Character = player.Character Hidden = false script.Parent.MouseButton1Click:connect(function() if Hidden == false then Character.Humanoid.HealthDisplayDistance = 0 Character.Humanoid.NameDisplayDistance = 0 Hidden = true script.Parent.Text = "Show Name" else Character.Humanoid.HealthDisplayDistance = 100 Character.Humanoid.NameDisplayDistance = 100 Hidden = false script.Parent.Text = "Hide Name" end end) script.Parent.TouchTap:connect(function() if Hidden == false then Character.Humanoid.HealthDisplayDistance = 0 Character.Humanoid.NameDisplayDistance = 0 Hidden = true else Character.Humanoid.HealthDisplayDistance = 100 Character.Humanoid.NameDisplayDistance = 100 Hidden = false end end)
what's the problem? Doesn't give me an output for some reason, or perhaps I simply missed it.
NameDisplayDistance and HealthDisplayDistance are apart of Player
So change Character.Humanoid to player.
Your Problem is you are using the Character's Humanoid instead of the LocalPlayer, Now lets import it to your script.
local player = game.Players.LocalPlayer local Character = player.Character Hidden = false script.Parent.MouseButton1Click:connect(function() if Hidden == false then player.HealthDisplayDistance = 0 player.NameDisplayDistance = 0 Hidden = true script.Parent.Text = "Show Name" else player.HealthDisplayDistance = 100 player.NameDisplayDistance = 100 Hidden = false script.Parent.Text = "Hide Name" end end) script.Parent.TouchTap:connect(function() if Hidden == false then player.HealthDisplayDistance = 0 player.NameDisplayDistance = 0 Hidden = true else player.HealthDisplayDistance = 100 player.NameDisplayDistance = 100 Hidden = false end end)
Hope this Helped.