Help why wont this morph work?

Try this. Don’t destroy the character and replace it, destroy it’s physical instances and replace them.

How would I do that? Like destroy leftleg right leg, head, into I’m so confused

for _, inst in pairs(Character:GetChildren()) do
    if inst:IsA("Part") or inst:IsA("MeshPart") or inst:IsA("UnionOperation") then
        inst:Destroy()
    end
end

Something like that. Didn’t make that in studio, so the syntax may be wrong.

It just kills the player and how would I replace it then just put NewCharacter.Parent = inst?

Clone all of the new parts from the morph and parent them to the character (also set the primary part of the character to the HRP)

I did this

for _, inst in pairs(v.Character:GetChildren()) do
if inst:IsA(“Part”) or inst:IsA(“MeshPart”) or inst:IsA(“UnionOperation”) then
inst:Destroy()
for _, N in pairs(NewCharacter:GetChildren()) do

if N:IsA(“Part”) or inst:IsA(“MeshPart”) or inst:IsA(“UnionOperation”)

then
N:Clone().Parent = inst
end
end
end
end

and it didn’t work[quote=“Attyuo2, post:25, topic:1759201, full:true”]
Clone all of the new parts from the morph and parent them to the character (also set the primary part of the character to the HRP)
[/quote]

Sorry for asking, but could you please format that? I’m having trouble reading the code.

I tried how could I do that I pasted it straight from roblox studio and it’s put like this

for _, inst in pairs(v.Character:GetChildren()) do
if inst:IsA(“Part”) or inst:IsA(“MeshPart”) or inst:IsA(“UnionOperation”) then
inst:Destroy()
for _, N in pairs(NewCharacter:GetChildren()) do
if N:IsA(“Part”) or inst:IsA(“MeshPart”) or inst:IsA(“UnionOperation”) then
N:Clone().Parent = inst
end
end
end
end

To format code, use the </> button, or enclose it in ``` (copy and paste it AFTER the format tags are in so the indents are there)

for i, v in pairs(game:GetService("Players"):GetPlayers()) do
				local OldCharacter = v.Character
				print(v.Character.Name)
				local NewCharacter = game.ServerStorage:WaitForChild("AntCharacter"):Clone()
				
				print(NewCharacter.Name)
				for _, inst in pairs(v.Character:GetChildren()) do
					if inst:IsA("Part") or inst:IsA("MeshPart") or inst:IsA("UnionOperation") then
						inst:Destroy()
						for _, N in pairs(NewCharacter:GetChildren()) do
							if N:IsA("Part") or inst:IsA("MeshPart") or inst:IsA("UnionOperation") then
								N:Clone().Parent = inst
							end
						end
					end
				end

Sorry I figured it out xd my bad

@MGamer_Dev GnomeCode made a great tutorial on how to use custom characters check it out here. :slight_smile: CUSTOM CHARACTERS - How to create, rig and animate - YouTube

1 Like

I followed his tutorial when I couldn’t get it right and xd

1 Like

I HAVE FIGURED IT OUT! I’m so happy

1 Like

Mark this as a solution, so others don’t come on and try to answer this.

1 Like