Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Name Hide script is not working correct?

> game.Players.PlayerAdded:connect(function(plr)
    wait()
    plr.Humanoid.NameDisplayDistance = 0
	plr.Humanoid.HealthDisplayDistance = 0
	wait(5)
	script.Parent.Script:Destroy()
end)

In starterpack, the only output is I get is "Something unexpectedly tried to set the parent of to NULL while trying to set the parent of . Current parent is Backpack."

3 answers

Do this instead:

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:Wait() - wait for character to be added in
plr.Humanoid.DisplayDistanceType = "None" -- ain't nobody viewing le display!!1! mwahwaha
wait(5)
script.Parent:Destroy()

Your real problem was

script.Parent.Script:Destroy() -- the second "Script" is useless
--[[ INSTEAD DO --]]
script.Parent:Destroy()
-- or
script:Destroy()

Also... why exactly is this in a tool?

2 comments

0

It's not in a tool, Just a script in a starter pack, I just like to keep script that are for players but need to be deleted after in starter pack, just cause.

0

This did not work.

make sure to put this is startercharacterscripts

local player = game.Players.LocalPlayer
local playerpart = game.Workspace:WaitForChild(player.Name)
local human = playerpart.Humanoid

human.NameDisplayDistance = 0
human.HealthDisplayDistance = 0

Final script:

	script.Parent.Humanoid.DisplayDistanceType = "None"
	wait(10)
	script:Destroy()

This discussion is preserved as it was. New answers, comments, and votes are closed.