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

How can I add a "mesh" texture to this Tycoon Dropper Script ?

Asked by 8 years ago

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 :

01wait(2)
02workspace:WaitForChild("PartStorage")
03 
04while 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 - Vector3.new(0,1.4,0)
13    part.FormFactor = "Custom"
14    part.Size=Vector3.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
18end``

4 answers

Log in to vote
0
Answered by
AZDev 590 Moderation Voter
8 years ago
Edited 8 years ago

I'm assuming you want to use a roblox mesh. Not a mesh part.

In which case you would add this to your loop:

1local Mesh = Instance.new("SpecialMesh", part)
2Mesh.MeshType = Enum.MeshType.FileMesh
3Mesh.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.
Ad
Log in to vote
0
Answered by 8 years ago
Edited 8 years ago
01wait(2)
02workspace:WaitForChild("PartStorage")
03 
04while true do
05    wait(1.5) -- How long in between drops
06    local part = Instance.new("Part",workspace.PartStorage)
07part.Name=("PartOfCash")--if your dropper has a theme etc add t he name to partofcash so it doesnt mesh other parts!!
08local 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!!--
09meshpart.MeshType=("FileMesh")
10meshpart.MeshId=("idhere")--add a id
11meshpart.TextureId=("Textureidhere")--add a texture id here!!   
12part.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"
View all 23 lines...

NOTE THERES A CHANCE THIS WONT WORK BECAUSE I DID THIS WITHOUT CHECKING FOR ERRORS!

0
Would really love if you accepted either one of our answers. Coolboyok11 64 — 8y
Log in to vote
0
Answered by 8 years ago

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!

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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)

01wait(2)
02workspace:WaitForChild("PartStorage")
03 
04while 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
View all 22 lines...

If it worked, please Accept the answer!

Any questions? Ask the in the comments!

Have a nice day!

Answer this question