Help with character legs

What is your problem?

I have made a character morph. It works, but the legs of the character do not move after you morph.

What have you tried to solve your problem?

I have tried to play the character as a StarterCharacter and use the default Roblox animation script but every time I insert the script into the character, it does not work.

Anything to show us regarding your problem?

Here is my script
local replicatedStorage = game:GetService("ReplicatedStorage")
local characters = replicatedStorage:WaitForChild("Characters")
local events = replicatedStorage:WaitForChild("Events")


local function onPlayerAdded(player)
	local justJoined = Instance.new("BoolValue")
	justJoined.Name = "JustJoined"
	justJoined.Value = true
	justJoined.Parent = player
end

local function changeRole(player, gender, role)
	if gender and role then
		if gender ~= "" and role ~= "" then
			local foundGender = characters:FindFirstChild(gender)
			if foundGender then
				local foundRole = foundGender:FindFirstChild(role)
				if foundRole then
					local morphCharacter = foundRole:Clone()
					
					local playersHumanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
					local morphCharactersHumanoidRootPart = morphCharacter:FindFirstChild("HumanoidRootPart")
					
					if morphCharactersHumanoidRootPart and playersHumanoidRootPart then
						morphCharactersHumanoidRootPart.CFrame = playersHumanoidRootPart.CFrame
					end
					
					morphCharacter.Parent = workspace
					player.Character = morphCharacter
					
					events:WaitForChild("Camera"):FireClient(player)
				end
			end
		end
	end
end


events.ChangeRole.OnServerEvent:Connect(changeRole)
game.Players.PlayerAdded:Connect(onPlayerAdded)
Here is a video regarding the problem

robloxapp-20210626-0917414.wmv (739.8 KB)

Do you wanna thank us in advance?

Thanks in advance!