Changing avatar face when they load in, not working

I’m trying to set the avatar’s face when they load in, but it seems no matter what I do, it won’t change it.

Here is my code:

self.Head.Mesh.MeshId = 'rbxassetid://7390281327'

print('1')

self.Head.face.Texture = 'rbxassetid://5341320658'

print('2')

Both prints are printing out correctly.

“self” is a variable referring to the player’s character.
Changing the mesh works fine, but changing the face doesn’t.
This is a server script in StarterCharacterScripts.

Solution:
It seems the problem was that I was changing the face before the character fully loaded in, and then the face was being changed back to the default after I had changed it.
This is what the beginning of my script looks like now:

local self = script.Parent
local plr = game:GetService("Players"):GetPlayerFromCharacter(self)
plr.CharacterAppearanceLoaded:Wait()

Why not use HumanoidDescription and apply that to the character?

1 Like

The texture I am applying is not a face, and I’ve made other modifications to the character that will be broken if using HumanoidDescription.

1 Like
  1. Does the first print work?
  2. Mind showing where you defined self and the main module/script?
1 Like

I defined it as this on the very first line in the script:

local self = script.Parent

I think it might be a good idea to wait for the avatar to fully load in before making changes. Any idea on how to do that?

Player.CharacterAppearenceLoaded:Wait() or Player.CharacterAppearenceLoaded:Connect(function)

1 Like

Try to give the variable a different name
Also try to print some more things to see where the issue is

You could maybe try to do like:

local cr = script.Parent
local head = cr:FindFirstChild("Head")
local face = head.face
--try to print and check if head and face exist
--do your stuff here
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.