So im learning some Morph stuff and have started deconstructing a piece of code that works on an old game I had given to me BUT while trying to “modernize” the code, I am unable to remove or hide any of the body parts.
Right now, the morph works and my head is welded to the new part I create, but the original character body/arms/legs all remove visible.
Here is me ingame
Here is my code
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
if char:findFirstChild("IsaMorph") == nil then
local mesh = char.Head:findFirstChild("Mesh")
mesh.Scale = Vector3.new(1, 1, 1)
local core = char.HumanoidRootPart
core.Transparency = 1
core.CanCollide = false
local uppercore = char:WaitForChild("UpperTorso")
uppercore.Transparency = 1
uppercore.CanCollide = false
if char:findFirstChild("FakeTorso") ~= nil then
char:findFirstChild("FakeTorso"):remove()
end
local body = Instance.new("Part")
body.BrickColor = BrickColor.new(1)
body.Parent = char
body.Position = core.Position
body.Name = "FakeTorso"
body.formFactor = "Symmetric"
body.Size = Vector3.new(1,1,1)
local w1 = Instance.new("Weld")
w1.Parent = core
w1.Part0 = w1.Parent
w1.Part1 = body
w1.C1 = CFrame.new(0, 0.25, 0)
local w2 = Instance.new("Weld")
w2.Parent = core
w2.Part0 = w1.Parent
w2.Part1 = char.Head
w2.C1 = CFrame.new(0, -0.8, 0)
local bodymesh = Instance.new("SpecialMesh")
bodymesh.Scale = Vector3.new(1.2, 1.5, 1.2)
bodymesh.Parent = body
local rightupperarm = char:findFirstChild("RightUpperArm")
if rightupperarm ~= nil then
rightupperarm:remove()
end
local rightlowerarm = char:findFirstChild("RightLowerArm")
if rightlowerarm ~= nil then
rightlowerarm:remove()
end
local righthand = char:findFirstChild("RightHand")
if righthand ~= nil then
righthand:remove()
end
local rightleg = char:findFirstChild("Right Leg")
if rightleg~= nil then
rightleg:remove()
end
local leftarm =char:findFirstChild("Left Arm")
if leftarm~= nil then
leftarm:remove()
end
local leftleg = char:findFirstChild("Left Leg")
if leftleg ~= nil then
leftleg:remove()
end
local marker = Instance.new("StringValue")
marker.Parent = char
marker.Name = "IsaMorph"
local characterparts = char:getChildren()
for i=1,#characterparts do
if characterparts[i].className == "Part" then
characterparts[i].Locked = true
end
if characterparts[i].className == "Hat" then
characterparts[i].Handle.Locked = true
end
end
end
end)
end)