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

How do I insert a mesh into a block using a script?

Alright so basically I need to make a block turned into a hat. How would I use a script to complete that?

2 answers

✓ Accepted answer

Create a new mesh, and then parent it to the part:

Instance.new("SpecialMesh", game.Workspace.Part)

2 comments

0

Alright Thanks alot man! :D

0

No problem!

If you wanted to make it simpler by using the :Clone() function you could do this:

Put a mesh in lighting, or somewhere else, then add a script wherever. Let's say when you hit a part, it will clone a mesh from lighting, and place it in your torso.

script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if hit.Parent:FindFirstChild("Torso") then
			cloneMesh = game.Lighting.Mesh:Clone()
			cloneMesh.Parent = hit.Parent.Torso
		end
	end
end)

There you go!

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