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

(fixed)Can someone help me with this mesh?

Asked by 9 years ago

ok, I have many droppers that I want to change the way the blocks look when they are dropped

I have 10 different mesh that I will be using

I have tried different methods of adding the mesh with no success

can someone help please?

this is the script for the first giver that gives a block when clicked the others will auto drop

debounce = false
script.Parent.Button.ClickDetector.MouseClick:connect(function()
    if debounce == false then
        debounce = true
        script.Parent.Button.BrickColor=BrickColor.new("Bright red")
        local part = Instance.new("Part",workspace)
        local cash = Instance.new("IntValue",part)
        cash.Name = "Cash"
        part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
        cash.Value = 1
        part.CFrame = script.Parent.Drop.CFrame
        part.Size=Vector3.new(1,1,1)
        game.Debris:AddItem(part,20)
        wait(0.2) -- Time to wait in between clicks
        debounce = false
        script.Parent.Button.BrickColor=BrickColor.new("Bright green")
    end
end)

I have tried adding this to the script but it didn't work

local nMesh = Instance.new("SpecialMesh")

nMesh.MeshType = "FileMesh"

nMesh.ID = 19059116

1 answer

Log in to vote
0
Answered by
Wizzy011 245 Moderation Voter
9 years ago

Firstly, when you're setting the ID of an object, it should contain http://www.roblox.com/asset/?id= before it, as that way it actually is an asset rather than just an integer! The other reason your mesh won't work is because you haven't actually set the Parent of the mesh, it should either have nMesh.Parent = part or you could add part into the Instance.new!

Overall, your code would look like this:

debounce = false
script.Parent.Button.ClickDetector.MouseClick:connect(function()
    if debounce == false then
        debounce = true
        script.Parent.Button.BrickColor=BrickColor.new("Bright red")
        local part = Instance.new("Part",workspace)
        local cash = Instance.new("IntValue",part)
        cash.Name = "Cash"
        part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
        cash.Value = 1
        part.CFrame = script.Parent.Drop.CFrame
        part.Size=Vector3.new(1,1,1)
    local nMesh = Instance.new("SpecialMesh", part)
    nMesh.MeshType = "FileMesh"
    nMesh.MeshId = "http://www.roblox.com/asset/19059116"
        game.Debris:AddItem(part,20)
        wait(0.2) -- Time to wait in between clicks
        debounce = false
        script.Parent.Button.BrickColor=BrickColor.new("Bright green")
    end
end)
0
thanks for the quick response, but i have tried that before and it didnt work. so i copied yours and just put it in the script, and it stilll didnt work. The script came back with an error(11:56:48.584 - ID is not a valid member of SpecialMesh 11:56:48.585 - Script 'Workspace.Tycoons.Brightblue.PurchasedObjects.Mine.DropperS', Line 16) snipers0076 5 — 9y
0
My bad, I didn't bother to check if you'd used the correct namings, it should be MeshId, not ID Wizzy011 245 — 9y
0
I changed the MeshID, to MeshId and it still didnt work, it poped up with the same error snipers0076 5 — 9y
0
finally got it , thanks for the help.... snipers0076 5 — 9y
0
how would i add a decal to that snipers0076 5 — 9y
Ad

Answer this question