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

Why isn't the character's head disappearing?

The player's head is supposed to disappear every time they spawn. I am getting an output. Here is my LocalScript inside StarterGui.

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local head = character:WaitForChild("Head")

head.Transparency = 1
script:Destroy()

This is the output I am receiving:

18:12:11.087 - WaitForChild is not a valid member of Model

18:12:11.088 - Script 'Players.Player.PlayerGui.LocalScript', Line 4

18:12:11.088 - Stack End

All help is appreciated.

Thanks. :)

2 comments

0

Try the "FindFirstChild" method instead of the "WaitForChild" method.

0

FindFirstChild is not a valid member of Model, Script 'Players.Player.PlayerGui.LocalScript', Line 4, Stack End

2 answers

I copied your script into a Localscript in StarterGui, and It worked.

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local head = character:WaitForChild("Head")
head.Transparency = 1
script:Destroy()

Tips -

You might want to remove the hats on the player if there are any You also might want to remove the face of the person since it still shows on an invisible head.

3 comments

0

Really? That's weird. I get the output error, and in Explorer, the Head still has 0 Transparency.

0

This could be because I'm always testing on "play solo", maybe it doesn't work on online mode like you are testing it on

0

I get the error on Play Solo AND Online (Developer Console says it).

Try adding a wait before it destroys the script. Because once the script runs, it's destroyed. If you don't know where to put it, i'll show you:

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local head = character:WaitForChild("Head")

head.Transparency = 1
wait(1)
script:Destroy()

1 comment

0

Same error. Same Output.

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