Humanoid:ApplyDescription() does not work

Hi all,

I’m making a round-based game where on each round you play a random character, so I pre-made a bunch of HumanoidDescriptions for that. Now when I try to apply the randomly selected HumanoidDescription to the player’s humanoid, it is inconsistent. Sometimes it works, sometimes the script breaks. And when it breaks, the output shown below appears.

function pickCharacter(player, humanoid)
  local chosenCharacter = script.Characters.Descriptions:GetChildren()[math.random(1, #script.Characters.Descriptions:GetChildren())]
  local blankDesc = Instance.new("HumanoidDescription")
  humanoid:ApplyDescription(blankDesc)
  wait()
  humanoid:ApplyDescription(chosenCharacter)
end

As far as I know, from my code, I have tried to reset the “current” description by changing it into a blank one before giving the chosen character to the player. But that isn’t enough. Does anyone know how I should proceed?

Thank you in advance!

Seems like you can’t apply it by the fact it contains common assets on both Descriptions. Not sure why it would error because of it. But my best guess is to try removing duplicates?

1 Like

I never understood what the error meant anyway. The “current” description is the player’s avatar and I have no control over it. The new descriptions are the ones I prepared for the game. I’m not sure what you mean by removing duplicates. When I apply a blank description, there must be no possibility for a duplicate to be there.

Try parenting the humanoid description to the character , then apply it. See if it’ll work

I have done some tests and it turns out the problem was due to the fact that I made an oopsie-whoopsie somewhere and accidentally put an asset ID in the wrong property in one of the 50+ characters, which explains why sometimes it works and sometimes it doesn’t.

Now I have to check one by one all of them and see which one is the problem. :sob:

2 Likes