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