Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to add FaceTemplate to Avatar Editor?

I am wondering how I can grab the FaceTemplate to allow users to change their faces. I have the ShirtsTemplate and PantsTemplate already but I'd like to know how to add the FaceTemplate, if there is one. I have tried looking this up but I am not finding anything that can help me.

Here is the code, notice that there is no facetemplate to grab the face from the catalog:

if not workspace:FindFirstChild("AvatarEvent") then
	local event = Instance.new("RemoteEvent")
	event.Name = "AvatarEvent"
	event.Parent = workspace
end
local event = workspace.AvatarEvent
local insertS = game:GetService("InsertService")

event.OnServerEvent:Connect(function(player, id)
	local number = tonumber(id)
	if not number then return end
	local asset
	local char = player.Character
	local success = pcall(function()
		asset = insertS:LoadAsset(number)
	end)
	
	if not success then return end
	local child = asset:GetChildren()
	for _,v in pairs(child) do
		if v:IsA("Accessory") then
			char.Humanoid:AddAccessory(v)
		elseif v:IsA("Shirt") then
			local templ = v.ShirtTemplate
			char.Shirt.ShirtTemplate = templ
		elseif v:IsA("Pants") then
			local templ = v.PantsTemplate
			char.Pants.PantsTemplate = templ
		end
	end
	asset:Destroy()
end)

1 comment

0

Maybe instead of a FaceTemplate it is a body part? Any ideas anyone?

1 answer

Faces are handled through Decals. So you can easily just have a decal that you can change the .Texture to the AssetId of the image of the face you want.

This discussion is preserved as it was. New answers, comments, and votes are closed.