Get Player's face

Hey,

I have a StarterCharacter and I want it to get the Player’s face he has in roblox.

How would I get just his faceid?

Would be necessary in a server side script…

1 Like
--local script into StarterCharacterScripts
local player = game.Players.LocalPlayer
local FaceId = script.Parent:WaitForChild("Head").face.Texture

print(FaceId) -- test

If you only want their face to change on the client, then it will be necessary to use a LocalScript (or a ServerScript with the RunContext set to “Client”).
Otherwise, if you want it to change for everyone in the server, it is necessary to use a ServerScript.

And this how you get the player's face (on a ServerScript)
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local face = char:WaitForChild("Head"):FindFirstChild("face")
		face.Texture = "rbxasset://textures/face.png" --// default face. Change it to "rbxasset://FaceId" to change it to a custom face.
	end)
end)

Use the code from @Kingmaster_GamePlay in post #2 for client code if you need it.
Follow the same steps from my server code to change the face texture ID.


ALSO KEEP THIS IN MIND:

You CANNOT just use the website ID for a face (by Roblox or custom)!
There is a difference between an asset’s website ID and studio ID. If you take any decal, animation, audio, etc. ID, it will change when putting it into studio. It cannot set the ID of the face if you use the website ID.

1 Like

You’ll want to copy the face when the player loads, then set their character to the custom character (and camera), rather than using StarterCharacter.

I think you misunderstood me a little, hehe.

What I meant was:

The player gets a Outfit in the game, you have the classic roblox smile face.

I want to get the → PLAYERS INVENTORY FACE ← (The one he is wearing in ROBLOX) though.

I actually want to access the players stuff he wears in roblox, pick his face, and put the id of his face on the starter character.

I would need to rework our entire game framework, therefore I want it to be done differently.

How would I get the face the player has IN roblox though, alot of games do it…

I want the face he has on his avatar selected, placed onto the startercharacter

You could use this:

local Players = game:GetService("Players")

local appearance = Players:GetHumanoidDescriptionFromUserId(--[[UserId]])
local face = appearance.Face
1 Like
	local appearance = Players:GetHumanoidDescriptionFromUserId(Player.UserId)
		local face = appearance.Face
		if Player.Character.Head:FindFirstChild("face") then
	print(face)
			Player.Character.Head.face.Texture = face
		end```
I did that, but when printing face the face is 0.
1 Like