When the players joins it should remove their face. But it does nothing. This script is in the workspace.
1 | function playerJoined(plr) |
2 | local char = plr.Character |
3 | local head = char.Head |
4 | local face = head:WaitForChild( "face" ) |
5 | face:remove() |
6 | end |
7 |
8 | game.Players.ChildAdded:connect(playerJoined) |
Try this:
(First of all this is a localscript inside starterpack)
1 | Player = game.Players.LocalPlayer |
2 |
3 | wait( 1.4 ) |
4 | if Player.Character.Head:FindFirstChild( "face" ) then |
5 | Player.Character.Head.face:remove() |
6 | else |
7 | print ( "Face remover script broken." ) |
8 | end |
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:
01 | function playerJoined(plr) |
02 | plr.CharacterAdded:connect( function (char) |
03 | wait() |
04 | local head = char.Head |
05 | head:WaitForChild( "face" ):Destroy() |
06 | char.ChildAdded:connect( function () |
07 | if head:FindFirstChild( "face" ) then |
08 | head.face:Destroy() |
09 | end |
10 | end ) |
11 | end ) |
12 | end |
13 |
14 | game.Players.ChildAdded:connect(playerJoined) |