Skinned Mesh Character Morphs not working correctly

Hi, So Im making a game with skinned mesh character morphs and when I morph a player, It kills them and resets them. Any Idea on whats happening?

Heres the Script:

game.ReplicatedStorage.Events.TelepLRParentchange.OnServerEvent:Connect(function(plr,OwnsGamepass,ChangintoParent,changeval)
	local DadModel = game.ReplicatedStorage.ParentObjects.Models.Dad
	local playrname
	if OwnsGamepass == true  and ChangintoParent == true and changeval == true then
		print("SERVEER OWNGAMEPASS")
		local oldchar = plr.Character
	
		local newchar = DadModel:Clone()
		print(newchar.Humanoid.Health)
		playrname = plr.Name
		newchar.Name =playrname
		plr.Character = newchar
		wait(1)
		newchar.Parent = workspace
		local newscripts = game.ReplicatedStorage.RepGui.Prnt.Scripts:GetChildren()
		newchar.HumanoidRootPart.CFrame = oldchar.HumanoidRootPart.CFrame * CFrame.new(0,5,0)
		game.ReplicatedStorage.Events.TelepLRParentchange:FireClient(plr,newchar)
		wait(0.37)
		local oldcharobjects = oldchar:GetChildren()
		for i = 1, #oldcharobjects do
			if oldcharobjects[i]:IsA("Script") or oldcharobjects[i]:IsA("LocalScript") then
				oldcharobjects[i]:Destroy()
			end
		end
		game.ReplicatedStorage.RepGui.Prnt.Animate:Clone().Parent = newchar


		oldchar.Parent = game.ReplicatedStorage.ClonedPlr



		newchar.Humanoid.Died:Connect(function()
			wait(game.Players.RespawnTime)
			plr:LoadCharacter()
			print("LOADED CHAR")
		end)
	else
		print("SERVEER OWNGAMEPASS")
		local oldchar = plr.Character

		local newchar = game.ReplicatedStorage.ClonedPlr:FindFirstChild(plr.Name)
		plr.Character = newchar
		print("NEWHCAR" ..newchar.Name)
		newchar.Parent = workspace
		newchar.HumanoidRootPart.CFrame = oldchar.HumanoidRootPart.CFrame * CFrame.new(0,5,0)
		game.ReplicatedStorage.Events.TelepLRParentchange:FireClient(plr,newchar)
		wait(0.37)
		game.ReplicatedStorage.ClonedPlrScripts.Animate:Clone().Parent = newchar
		oldchar:Destroy()

		



		

	end
	
	if OwnsGamepass == true  and ChangintoParent == false and changeval == false then
		
	end
	
	if OwnsGamepass == true and ChangintoParent == false then
		print("ChangingToBABY")
	end
end)

Thank you for the help!

1 Like

It is happening either because of the following code:

newchar.Humanoid.Died:Connect(function()
	wait(game.Players.RespawnTime)
	plr:LoadCharacter()
	print("LOADED CHAR")
end)

or because of there is something wrong with Humanoid properties or Model structure.

Yea, I got rid of it but it Did nothing

image
This is the structure