Bug while using PromptSaveAvatar AvatarEditorService

Hi!

While testing the AvatarEditorService Im facing an issue with PromptSaveAvatar.
Apparently when saving a HumanoidDescription that has 2 FaceAccessories its only applying one into the roblox character of the player, not both. (player’s account owns both accessories bought from roblox marketplace)
Probably this bug its already documented but I can’t find any information.

Is there any workaround to tackle this?

REPLICATION SCRIPT BUG.
Paste this in a Local Script, inside CharacterScripts or any folder that client owns:

local AES = game:GetService("AvatarEditorService")
local PLY = game.Players.LocalPlayer -- Be sure your current roblox character uses at least 2 FaceAccessories
local CHAR = PLY.Character or PLY.CharacterAdded:Wait()

AES:PromptAllowInventoryReadAccess()

local result = AES.PromptAllowInventoryReadAccessCompleted:Wait()
if result == Enum.AvatarPromptResult.Success then
	local HumDescWithDoubleAccessories = game.Players:GetHumanoidDescriptionFromUserId(PLY.UserId)
	-- Checking if you have enough FaceAccessories in your AV
	if string.find(HumDescWithDoubleAccessories.FaceAccessory, ",") ~= nil then
		warn("your AV has at least 2 facesAccs, BUG") -- One of your FaceAccessories will be removed
	else
		warn("your AV has only one face accessory so everything normal, no bug to see")
	end
	AES:PromptSaveAvatar(HumDescWithDoubleAccessories, CHAR:WaitForChild("Humanoid").RigType) -- THE BUG
end

This bug happens with :PromptCreateOutfit() as well, and its kinda obvious… As many of you know, in order to add a Secondary FaceAccessory on Roblox website its needed to click Advanced feature and add the IDs.

I just wanna know any workaround to do this inside a experience, adding more than one Accessory into the same Category of the Main Roblox Avatar of a player

Can you show the bit of code where you are calling the method?

1 Like

Sure, but my code is way more complicated to just show it.
But you can do a test of what Im saying by testing this code in a local script in a fresh baseplate if your roblox avatar is wearing at least 2 FaceAccessories (Im not sure if this happens on other categories too, but, could be):

local AES = game:GetService("AvatarEditorService")
local PLY = game.Players.LocalPlayer -- Be sure your current roblox character uses at least 2 FaceAccessories
local CHAR = PLY.Character or PLY.CharacterAdded:Wait()

AES:PromptAllowInventoryReadAccess()

local result = AES.PromptAllowInventoryReadAccessCompleted:Wait()
if result == Enum.AvatarPromptResult.Success then
	local HumDescWithDoubleAccessories = game.Players:GetHumanoidDescriptionFromUserId(PLY.UserId)
	-- Checking if you have enough FaceAccessories in your AV
	if string.find(HumDescWithDoubleAccessories.FaceAccessory, ",") ~= nil then
		warn("your AV has at least 2 facesAccs, BUG") -- One of your FaceAccessories will be removed
	else
		warn("your AV has only one face accessory so everything normal, no bug to see")
	end
	AES:PromptSaveAvatar(HumDescWithDoubleAccessories, CHAR:WaitForChild("Humanoid").RigType) -- THE BUG
end

If your avatar has more than one FaceAccessories on join, you will see that the prompt is asking you to apply an avatar with only one of those on your account

1 Like

For example, I did test it with your Avatar ID, and you don’t have 2 FaceAccessories, so you wont experience the issue as Im describing it:

local AES = game:GetService("AvatarEditorService")
AES:PromptAllowInventoryReadAccess()
local YOU = 9009414 -- YOUR ID

local result = AES.PromptAllowInventoryReadAccessCompleted:Wait()
if result == Enum.AvatarPromptResult.Success then
	local HumDescWithDoubleAccessories = game.Players:GetHumanoidDescriptionFromUserId(YOU) -- Using your ID for the test
	if string.find(HumDescWithDoubleAccessories.FaceAccessory, ",") ~= nil then
		warn("your AV has at least 2 facesAccs, BUG")
	else
		warn("your AV has only one face accessory, everything normal, no bug to see")
	end
	AES:PromptSaveAvatar(HumDescWithDoubleAccessories, Enum.HumanoidRigType.R15)
end

I fell asleep, anyway, I wanted to see just the general area, so I could see what parameters you were passing in, and how they were formatted.

Just looking at the code it looks ok, but I will test it a bit later today.
You might want to put in a bug report anyway.

1 Like