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

Why is this script not removing the players face when they join?

When the players joins it should remove their face. But it does nothing. This script is in the workspace.

function playerJoined(plr)
	local char = plr.Character
	local head = char.Head
	local face = head:WaitForChild("face")
	face:remove()
end

game.Players.ChildAdded:connect(playerJoined)

2 answers

✓ Accepted answer

Try this:

(First of all this is a localscript inside starterpack)

Player = game.Players.LocalPlayer

wait(1.4)
if Player.Character.Head:FindFirstChild("face") then
Player.Character.Head.face:remove()
else
print("Face remover script broken.")
end

3 comments

0

I had to change :FindFirstChild to :WaitForChild and that fixed it!

0

Np.

0

Just a tip: this method doesn't work with FilteringEnabled

The Player arrives before the Character.

What this means is that you have to wait for the Character to show up before you can access any part of it:

EDIT: I just did some testing, and it looks like the code does remove the initial face, but not one that loads when the CharacterAppearance loads. This code should fix that:

function playerJoined(plr)
    plr.CharacterAdded:connect(function(char)
        wait()
        local head = char.Head
        head:WaitForChild("face"):Destroy()
		char.ChildAdded:connect(function()
			if head:FindFirstChild("face") then
				head.face:Destroy()
			end
		end)
    end)
end

game.Players.ChildAdded:connect(playerJoined)

5 comments

0

Its not working :o I thought that it would!

0

You are missing an ) at the end of the first end but even if I fix that it doesn't work at all

0

Are you getting any output?

0

I am not getting any output. It's in the workspace too by the way.

0

And its a normal script non-local

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