It seems that whatever I try, my script wont change the face of the player upon spawn. The script doesnt show any errors because it continues on after the command to change the face texture. I've tried destroying the face then adding a new one and changing the texture but neither work. On the other hand, I grabbed a few of those face changing blocks and they all worked perfectly fine with the same sort of script command I have here so I'm utterly confused. Problem isn't with the script.Parent.mouth part either cause I've checked it at least 20 times
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character.CHARACTERRANDOM.Hair.Value = math.random(1,2) character.CHARACTERRANDOM.EyeColor.Value = math.random(1,6) character.Head.face.Texture = script.Parent.mouth.Texture local nose = game.ReplicatedStorage.nose:Clone() nose.Parent = character.Head
Maybe try waiting using WaitForChild:
character:WaitForChild("Head").face.Texture = script.Parent.mouth.Texture
If it doesn't work tell me.
You got to name the math.random. You cant just do math.random, since it doesn't know what you mean. Unless you are doing it by numbers.
-------------=/Tables\=------------- --HairTable HairTable = {} HairTable[1] = "Hair1" --Change to whatever you wanna call the hair. HairTable[2] = "Hair2" --Change to whatever you wanna call the hair. --EyeTable EyeTable = {} EyeTable [1] = "Eye1" --Change to whatever you wanna call the eye color. EyeTable [2] = "Eye2" --Change to whatever you wanna call the eye color. EyeTable [3] = "Eye3" --Change to whatever you wanna call the eye color. EyeTable [4] = "Eye4" --Change to whatever you wanna call the eye color. EyeTable [5] = "Eye5" --Change to whatever you wanna call the eye color. EyeTable [6] = "Eye6" --Change to whatever you wanna call the eye color. game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character.CHARACTERRANDOM.Hair.Value = HairTable[math.random(1,2)] character.CHARACTERRANDOM.EyeColor.Value = EyeTable[math.random(1,6)] character.Head.face.Texture = script.Parent.mouth.Texture local nose = game.ReplicatedStorage.nose:Clone() nose.Parent = character.Head end) end)