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

How do I change a brick's parent and its MeshFile?

Alright so I want x to still be in p when I change the parent of p. I've tried this but it doesn't work:

function fire()
	local p = Instance.new("Part")
	p.Name = "Something"
	p.Position = script.Parent.Position
x = Instance.new("FileMesh", p)
x.MeshId = "http://www.roblox.com/asset/?id=1286103"
x.Parent = p
p.Parent = script.Parent

end 

Please explain how I would keep the mesh with it's parent.

1 comment

0

It looks like you're trying to parent 'p' to another part?

1 answer

Want to know something interesting? A filemesh isn't an object. What you want is a special mesh with the MeshType set as a FileMesh


function fire()
	local p = Instance.new("Part")
	p.Name = "Something"
	p.Position = script.Parent.Position
	x = Instance.new("SpecialMesh")
	x.MeshType="FileMesh"
	x.MeshId = "http://www.roblox.com/asset/?id=1286103"
	x.Parent = p
	p.Parent = script.Parent
end 

fire()

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