I got this basic script that I would like to modify to add a mesh to the part. For information, this script is from a Zednov Tycoon Kit. Here is the script :
01 | wait( 2 ) |
02 | workspace:WaitForChild( "PartStorage" ) |
03 |
04 | while true do |
05 | wait( 1.5 ) -- How long in between drops |
06 | local part = Instance.new( "Part" ,workspace.PartStorage) |
07 | part.BrickColor = script.Parent.Parent.Parent.DropColor.Value |
08 | part.Material = script.Parent.Parent.Parent.MaterialValue.Value |
09 | local cash = Instance.new( "IntValue" ,part) |
10 | cash.Name = "Cash" |
11 | cash.Value = 5 -- How much the drops are worth |
12 | part.CFrame = script.Parent.Drop.CFrame - Vector 3. new( 0 , 1.4 , 0 ) |
13 | part.FormFactor = "Custom" |
14 | part.Size = Vector 3. new( 1.2 , 1.2 , 1.2 ) -- Size of the drops |
15 | part.TopSurface = "Smooth" |
16 | part.BottomSurface = "Smooth" |
17 | game.Debris:AddItem(part, 20 ) -- How long until the drops expire |
18 | end `` |
I'm assuming you want to use a roblox mesh. Not a mesh part.
In which case you would add this to your loop:
1 | local Mesh = Instance.new( "SpecialMesh" , part) |
2 | Mesh.MeshType = Enum.MeshType.FileMesh |
3 | Mesh.MeshId = "Put the ID of your mesh here" |
4 |
5 | -- Simple enough. |
6 | -- Usually I would try to provide wiki links and such to help you learn but this doesn't seem |
7 | -- applicable here. |
01 | wait( 2 ) |
02 | workspace:WaitForChild( "PartStorage" ) |
03 |
04 | while true do |
05 | wait( 1.5 ) -- How long in between drops |
06 | local part = Instance.new( "Part" ,workspace.PartStorage) |
07 | part.Name = ( "PartOfCash" ) --if your dropper has a theme etc add t he name to partofcash so it doesnt mesh other parts!! |
08 | local meshpart = Instance.new( "SpecialMesh" ,workspace.PartStorage.PartOfCash) --this creates a SpecialMesh! inside of a part!! to remember to change the PartOfCash inside of it aswell!!-- |
09 | meshpart.MeshType = ( "FileMesh" ) |
10 | meshpart.MeshId = ( "idhere" ) --add a id |
11 | meshpart.TextureId = ( "Textureidhere" ) --add a texture id here!! |
12 | part.BrickColor = script.Parent.Parent.Parent.DropColor.Value |
13 | part.Material = script.Parent.Parent.Parent.MaterialValue.Value |
14 | local cash = Instance.new( "IntValue" ,part) |
15 | cash.Name = "Cash" |
NOTE THERES A CHANCE THIS WONT WORK BECAUSE I DID THIS WITHOUT CHECKING FOR ERRORS!
a mesh? So go to a .obj file maker or get one from the store, then save your mesh as .obj and then put a mesh in the brick, make the mesh a filemesh and open the .obj file!
Well this is working for me, you just need to put your mesh in Server Storage and name it "Mesh" .
(Thats the original script from Zednov Tycoon Kit with the lines that I added for the mesh)
01 | wait( 2 ) |
02 | workspace:WaitForChild( "PartStorage" ) |
03 |
04 | while true do |
05 | wait( 1.5 ) -- How long in between drops |
06 | local part = Instance.new( "Part" ,workspace.PartStorage) |
07 | part.BrickColor = script.Parent.Parent.Parent.DropColor.Value |
08 | part.Material = script.Parent.Parent.Parent.MaterialValue.Value |
09 |
10 | local mesh = game.ServerStorage.Mesh:clone() -- This clones the mesh, |
11 | mesh.Parent = part -- Into the part! |
12 |
13 | local cash = Instance.new( "IntValue" ,part) |
14 | cash.Name = "Cash" |
15 | cash.Value = 5 -- How much the drops are worth |
If it worked, please Accept the answer!
Any questions? Ask the in the comments!
Have a nice day!