Custom Face Help

Hi,

I already have a script for the custom face, the problem is that the default roblox face is still present.

I tried using this:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(chr)
		chr.Head.face:Destroy()
	end)
end)

But the face isn’t removed. Any idea what’s wrong?

(also there are no errors)

1 Like

Is there any StarterCharacters in your game?

Try to use wait()

game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(chr)
wait()
chr.Head.face:Destroy()
end)
end)

This is a horrible solution; there is no guarantee that the head or face will be present, even after wait(). If there truly was a delay, you should be using :WaitForChild(childName: string) like so:

local head = chr:WaitForChild("Head");
local face = head:WaitForChild("Face");
face:Destroy();

Also, refer to @AlreadyPro’s post below.

1 Like

Try not to use wait.

Instead, use WaitForChild on Head. Also, you can just directly edit the texture instead.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(chr)
		chr:WaitForChild("Head"):WaitForChild("face").Texture = "your custom face here"
	end)
end)
2 Likes

Just change the image of the old face to your custom one.

But it’s not working with that I tested

Is it a Script or a LocalScript?

I mean script, but if using local script on StarterCharacterScript why not script.Parent:WaitForChild(“Head”):WaitForChild(“face”):Destroy()

An easy alternative can be added in StarterCharacterScripts

local Player = game:GetService('Players').LocalPlayer
Player.Character.Head.face:Destroy()
1 Like

It works for me in a server script so all that I can assume is that it’s in a LocalScript. PlayerAdded will NOT return the localplayer on the client, because the script only runs when the player is loaded in. Try using this localscript instead, in StarterGui:

local player = game:GetService('Players').LocalPlayer
player.Character:WaitForChild('Head').face:Destroy()

This also will not replicate, you need to do this in a server script to make it show on the server. The script you already provided us with should work, on the server.

edit: I actually found a solution while scrolling through the roblox devforum

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local head = character:WaitForChild("Head")

		repeat wait() until head ~= nil

		repeat wait() until head:FindFirstChildWhichIsA("Decal") ~= nil

		head:FindFirstChildWhichIsA("Decal"):Destroy()
	end)
end)
1 Like