Hi,
Bit of a strange bug, but I have a function that should retrieve a players’ character skin tone, face decal and hair accessory, and add them to a character for the game.
All of this used to work perfectly (when last checked about a week ago or so), however all of a sudden, after checking yesterday/today, both the setting of the skin tone AND face decal still work, however the hair Accessory feature no longer works? (So when they get put in game they have their personal avatars skin tone and face decal, but have no hair). Does anyone know why this is? My first thought is it could possibly be to do with some recent studio update that has rearranged the table hierarchy to obtain a players hair accessory, so if anyone who is relatively up to date with new features etc or this aspect of studio in general could give some insight, that would be much appreciated. The relevant function is below:
function module.GiveDetails(player)
local playerAppearance = Players:GetCharacterAppearanceInfoAsync(player.userId)
-- local data = game:GetService("HttpService"):JSONDecode(playerAppearance)
--print(data)
local character = player.Character
for index,asset in pairs(playerAppearance["assets"]) do
if asset["assetType"] then
local assetType = asset["assetType"]
if assetType["name"] == "Face" then -- Checks if the asset type is a Face
local faceId = asset["id"]
local faceAsset = InsertService:LoadAsset(faceId)
-- Loads the face asset into the game
faceId = faceAsset.face.Texture-- Gets texture id of the face asset
faceAsset:Destroy()
character.Head.face.Texture = faceId
end
if assetType["name"] == "Hair Accessory" then
local hairId = asset["id"]
local hairAsset = InsertService:LoadAsset(hairId)
hairId = hairAsset:FindFirstChildOfClass("Accessory")
hairId.Parent = character
hairAsset:Destroy()
end
end
end
local bodyColors = character:WaitForChild("Body Colors")
local BodyColours = playerAppearance["bodyColors"]
bodyColors.HeadColor = BrickColor.new(BodyColours["headColorId"])
bodyColors.LeftArmColor = BrickColor.new(BodyColours["leftArmColorId"])
bodyColors.LeftLegColor = BrickColor.new(BodyColours["leftLegColorId"])
bodyColors.RightArmColor = BrickColor.new(BodyColours["rightArmColorId"])
bodyColors.RightLegColor = BrickColor.new(BodyColours["rightLegColorId"])
bodyColors.TorsoColor = BrickColor.new(BodyColours["torsoColorId"])
end
Thanks!