My Objective:
I am trying to make a script which using humanoid description gets a players hair, head and face accessory then adds them to the players avatar ( note this is a custom StarterCharacter ).
My Problem:
The accessories are not going on to the avatar but their is no problems being printed in the output I have tried just having all accessories on the avatar but its not realy wha I would like an the waist accessory are weirdly position
Extra Info:
I though I would add this in and say that this is a non-published game
My Script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local playerChar = game.Players:CreateHumanoidModelFromUserId(player.UserId)
local humanoidDesc game.Players:GetHumanoidDescriptionFromUserId(player.UserId)
local accessoryList = humanoidDesc.HairAccessory
accessoryList = humanoidDesc.HatAccessory..accessoryList
accessoryList = humanoidDesc.FaceAccessory..accessoryList
accessoryList = string.split(accessoryList, ",")
for _, item in ipairs(accessoryList) do
for _, accessory in pairs(playerChar:GetChildren()) do
if accessory.Name == item then
accessory.Parent = character
end
end
end
end)
end)
Thanks for your help