fix: add error handling for ApplyDescriptionResetAsync and nil-check Head
This commit is contained in:
+13
-2
@@ -50,11 +50,22 @@ function convert.convertCharacter(humanoid: Humanoid): ()
|
||||
|
||||
humDesc.Head = targetMesh
|
||||
humDesc.Face = face
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user