Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I insert a SpecialMesh in a HumanoidRootPart?

I've been trying to make this script work but no luck so far.

player = game.Player.LocalPlayer
local character = player.Character
MeshInsert = Instance.new("SpecialMesh", character.HumanoidRootPart)

1 comment

0

Don't use the 2nd argument of Instance.new() It's deprecated.

1 answer

✓ Accepted answer

The second argument of Instance.new() is deprecated, which means you shouldn't use it anymore, and HumanoidRootPart has a transparency of 1, meaning you can't see it. Even with a mesh, I would suggest using Torso (R6) instaid of HumanoidRootPart. If your game is R15, just change the UpperTorso and LowerTorso mesh as they already are MeshParts.

-----------------------------------------------------------------------R6
player = game.Player.LocalPlayer
local character = player.Character
MeshInsert = Instance.new("SpecialMesh")
MeshInsert.Parent = character.Torso
MeshInsert.MeshId = "" --your mesh id
MeshInsert.TextureId = "" --your mesh texture id
-----------------------------------------------------------------------R15
player = game.Player.LocalPlayer
local character = player.Character
local Torso = character.UpperTorso
Torso.MeshId = "" --your (first) mesh id
Torso.TextureID = "" --your (first) mesh texture id
local Torso = character.LowerTorso
Torso.MeshId = "" --your (second) mesh id
Torso.TextureID = "" --your (second) mesh texture id

And if you NEED to use HumanoidRootPart, here you go:

player = game.Player.LocalPlayer
local character = player.Character
MeshInsert = Instance.new("SpecialMesh")
MeshInsert.Parent = character.HumanoidRootPart
MeshInsert.MeshId = "" --your mesh id
MeshInsert.TextureId = "" --your mesh texture id
character.HumanoidRootPart.Transparency = 0
--make sure the Torso (R6) or UpperTorso & LowerTorso (R15) are invisible by making thier transparency 1, otherwise it would look kinda wierd.

I hope this helped you!

FE SERVER SCRIPT EDITION:

game.Players.PlayerAdded:Connect(function(plr)
	repeat wait() until game.Workspace:FindFirstChild(plr) 
	local character = game.Workspace:FindFirstChild(plr) 
--from here the rest of the code is the same
	MeshInsert = Instance.new("SpecialMesh")
	MeshInsert.Parent = character.HumanoidRootPart
	MeshInsert.MeshId = "" --your mesh id
	MeshInsert.TextureId = "" --your mesh texture id
	character.HumanoidRootPart.Transparency = 0
	--make sure the Torso (R6) or UpperTorso & LowerTorso (R15) are invisible by making thier transparency 1, otherwise it would look kinda wierd.
end) --don't forget this end!

7 comments

0

It works, but how would I make it work with FilteringEnabled?

0

game.Players.ChildAdded:Connect(function(plr) repeat wait() until game.Workspace:FindFirstChild(plr.Name) local character = game.Workspace:FindFirstChild(plr.Name)

0

end)

0

Replace the first couple of lines of code with the new one, I'll edit the answer.

0

Alright, thanks!

0

I tried using it but it would not work. I tried several different solutions such as adding local in front of MeshInsert. I also tried to see what was going on in the output tab but there was nothing.

0

Never mind, I have fixed it. Thank you for your effort! I really appreciate it.

This discussion is preserved as it was. New answers, comments, and votes are closed.