This is a topic I wanted to make for quite sometime since I can’t find a single way to do this. So, I have a character model for my game, and I want my player to morph into that character. The problem is I’m not sure how to do it. I have made a system that can morph the character, but there are many limitations, such as not being able to change the body part meshes. Any help is appreciated!
local currentskin = p.EquippedSkin.Value
local c = p.Character
c.Archivable = true
local sabercolor = game.ReplicatedStorage.CharModels[currentskin].Properties.Theme.Value
for i,v in pairs(c:GetChildren()) do
if v:IsA("Accessory") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("BodyColors") or v:FindFirstChild("face") or v:IsA("Hat") then
if v:FindFirstChild("face") then
for e,s in pairs(v:GetChildren()) do
if s.Name == "face" then
s:Destroy()
end
end
else
v:Destroy()
end
end
end
local clone = game.ReplicatedStorage.CharModels[currentskin]:Clone()
for i,v in pairs(clone:GetChildren()) do
if v:IsA("Shirt") or v:IsA("Pants") or v:IsA("Accessory") or v:FindFirstChild("face") or v:IsA("BodyColors") or v:IsA("Hat") then
if v:FindFirstChild("face") then
v.face.Parent = c.Head
else
v.Parent = c
end
end
end
It works in a way, but I’m wondering if this is the most efficient way to do it? This system also has some limitations. I can’t change the bodyparts of the character, so I can’t morph the character to a bundle like Rthro.
If you cant put BodyParts in it, that means the model doesnt have humanoid in it and Correctly named parts (Example: Left Leg)
And thats good code so far you’ve made for the script. But not gonna lie that its messy:p