fix: add error handling for ApplyDescriptionResetAsync and nil-check Head

This commit is contained in:
2026-04-06 00:43:41 -04:00
parent cb7111b121
commit 32b9a7aee8
+14 -3
View File
@@ -50,11 +50,22 @@ function convert.convertCharacter(humanoid: Humanoid): ()
humDesc.Head = targetMesh
humDesc.Face = face
humanoid:ApplyDescriptionResetAsync(humDesc)
local ok, err = pcall(function()
humanoid:ApplyDescriptionResetAsync(humDesc)
end)
if not ok then
warn(`rbx-reface: failed to apply description: {err}`)
return
end
-- VERY UGLY HACK: iBot head texture workaround
if targetMesh == meshByName["iBot"] then
local head: MeshPart = humanoid.Parent:FindFirstChild("Head")
head.TextureID = "rbxassetid://97292285"
local head = humanoid.Parent:FindFirstChild("Head")
if head then
(head :: MeshPart).TextureID = "rbxassetid://97292285"
end
end
end