fix: support unsupported heads (hex, diamond, etc)
This commit adds support for the following heads: - Hex - Diamond - Cylinder Madness - Octoblox - iBot It does it in a sort of direct way but Roblox's support for these heads is lacking so this will be the method used for now
This commit is contained in:
@@ -7,9 +7,28 @@ local function headMeshFromHumanoidDescription(humDesc: HumanoidDescription): nu
|
||||
for _, bodyPartDescription in humDesc:GetChildren() do
|
||||
if not bodyPartDescription:IsA("BodyPartDescription") then continue end
|
||||
local HeadShape = bodyPartDescription.HeadShape
|
||||
|
||||
-- HACK: these heads are not fully supported yet
|
||||
if bodyPartDescription.AssetId == 77954380016578 then
|
||||
return meshByName["Hex"]
|
||||
end
|
||||
if bodyPartDescription.AssetId == 123297947692270 then
|
||||
return meshByName["Diamond"]
|
||||
end
|
||||
if bodyPartDescription.AssetId == 83797968787123 then
|
||||
return meshByName["CylinderMadness"]
|
||||
end
|
||||
if bodyPartDescription.AssetId == 124045894066016 then
|
||||
return meshByName["Octoblox"]
|
||||
end
|
||||
if bodyPartDescription.AssetId == 87670789201977 then
|
||||
return meshByName["iBot"]
|
||||
end
|
||||
|
||||
if HeadShape ~= "" then
|
||||
return meshByName[HeadShape]
|
||||
end
|
||||
warn(`Head with ID {bodyPartDescription.AssetId} has no mesh equivalent - defaulting to classic head`)
|
||||
end
|
||||
return meshByName["RobloxClassic"]
|
||||
end
|
||||
@@ -28,9 +47,16 @@ function convert.convertCharacter(humanoid: Humanoid): ()
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
humDesc.Head = targetMesh
|
||||
humDesc.Face = face
|
||||
humanoid:ApplyDescriptionResetAsync(humDesc)
|
||||
-- VERY UGLY HACK: iBot head texture workaround
|
||||
if targetMesh == meshByName["iBot"] then
|
||||
local head: MeshPart = humanoid.Parent:FindFirstChild("Head")
|
||||
head.TextureID = "rbxassetid://97292285"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -501,6 +501,13 @@ local faceByMesh: {[number]: number} = {
|
||||
[13675522887] = 9156275069,
|
||||
[13823067122] = 9650713776,
|
||||
[82223146991621] = 76233968067050,
|
||||
-- HACK: these heads are not fully supported yet
|
||||
[123297947692270] = 144075659,
|
||||
[77954380016578] = 144075659,
|
||||
[124045894066016] = 144075659,
|
||||
[83797968787123] = 144075659,
|
||||
[2432102561] = 144075659,
|
||||
[87670789201977] = 144075659
|
||||
}
|
||||
|
||||
return faceByMesh
|
||||
|
||||
Reference in New Issue
Block a user