Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
NecoBoss 194
10 years ago

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.

0
It looks like you're trying to parent 'p' to another part? TheGuyWithAShortName 673 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

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()
Ad

Answer this question