Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Name Hide script is not working correct?

Asked by 6 years ago
Edited 6 years ago
> 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

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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?

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. Twenty1chickens 4 — 6y
0
This did not work. Twenty1chickens 4 — 6y
Ad
Log in to vote
0
Answered by
Plieax 66
6 years ago

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

Log in to vote
0
Answered by 6 years ago

Final script:

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

Answer this question