How to make a character morph?

Here is the code to spawn the player as the model

local function respawnPlayer(plr, model)
	local model = game.ServerStorage:FindFirstChild(model) --This is the model that the player respawns as
	local oldModel = plr.Character
	local newModel = model:Clone()
	newModel.Name = plr.Name
	plr.Character = newModel
	newModel.Parent = game.Workspace 
	newModel:SetPrimaryPartCFrame(game.workspace.Spawn.CFrame) -- replace Spawn with the respawing part location
	for _, object in ipairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do -- this just copies all the scripts from startercharacterscripts, you can do this with player scripts too.
		local newObject = object:Clone()
		newObject.Parent = newModel
	end
	oldModel:Destroy()
end

Yes you can store the character morph with data storage, just store the name and call the function above with the name you stored

7 Likes