Title says it all.
Around 80% of the time player:LoadCharacterWithHumanoidDescription() works as intended.
The other 20% of the time, the player’s avatar retains their original clothing.
The function works 100% of the time in studio.
Here is the code which uses it:
local kitfolder = serverscriptservice.Kits
if player:GetAttribute("Position") == "GK" then
kitfolder = serverscriptservice.Goalkeeper_Kit
end
local teamkits
teamkits = kitfolder:FindFirstChild(kit)
if not teamkits then return end -- this doesn't return
local character = player.Character or player.CharacterAdded:Wait()
local humanoid: Humanoid = character:WaitForChild("Humanoid")
local description = humanoid:GetAppliedDescription()
description.Shirt = teamkits.Shirt.Value -- I can guarantee these IDS
description.Pants = teamkits.Pants.Value -- are valid
player:LoadCharacterWithHumanoidDescription(description)
I know it’s getting to the final line, because in order for a player to join the game, they HAVE to have loaded because CharacterAutoLoads is set to false.
I’d really appreciate if someone could tell me whether my code is wrong, or this function is just inherently unreliable (and of course, provide a solution!).