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

Part mesh not working?

Asked by
narfh 0
8 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

heres what I did and I cant get it to change the mesh of the part I tried to get it to make a mesh for the part and change it to the mesh seen down below and it keeps popping up error in studio and I don't understand it...

wait(2)
workspace:WaitForChild("PartStorage")


deb = true 
script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
    if deb == true then
        deb = false
            local part = Instance.new("Part",workspace.PartStorage)
            part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
            part.Material=script.Parent.Parent.Parent.MaterialValue.Value
            add.MeshId = "19040337"
            local cash = Instance.new("IntValue",part)
            cash.Name = "Cash"
            cash.Value = 1 -- How much the drops are worth
            part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)
            part.FormFactor = "Custom"
            part.Size=Vector3.new(1, 1, 1) -- Size of the drops
            part.TopSurface = "Smooth"
            part.BottomSurface = "Smooth"
            game.Debris:AddItem(part,20) -- How long until the drops expire
            wait(.15)
            deb = true
    end
end)

1 answer

Log in to vote
0
Answered by 8 years ago

You're not adding a mesh to the part, and I wasn't aware there was a method 'add' for anything.

But I've been proven wrong before.

Anyways try changing add.MeshId = "19040337" to

local mesh = Instance.new("SpecialMesh")
mesh.MeshId = 19040337
mesh.Parent = part
Ad

Answer this question