PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Change Player Body Parts

Change Player Body Parts

Jun 23 2018, 2:01 AM PST

Problem

You want to make the torso of all Roblox characters a sphere.

Solution

Use a SpecialMesh with a MeshType of Sphere.

game.Players.PlayerAdded:connect(function(pl)
	pl.Character:connect(function(c)
		repeat wait() until c:FindFirstChild('Torso')
		local mesh = Instance.new('SpecialMesh')
		mesh.MeshType = Enum.MeshType.Sphere
		mesh.Parent = c.Torso
	end)
end)

Discussion

There are several different types of ways you can get a mesh on a part, but there is an object called a SpecialMesh which provides us with a couple of preset meshes. One of these presets happens to be Sphere.

First we connect the PlayerAdded event as well as the CharacterAdded event. We then proceed to wait until the Torso is in the Character. Then we create a SpecialMesh inside of the torso of the new character. We then set the type of the new mesh to be a sphere using the MeshType enumeration.

Tags:
  • humanoid