Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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 :

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

while true do
	wait(1.5) -- How long in between drops
	local part = Instance.new("Part",workspace.PartStorage)
	part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
	part.Material=script.Parent.Parent.Parent.MaterialValue.Value
	local cash = Instance.new("IntValue",part)
	cash.Name = "Cash"
	cash.Value = 5 -- How much the drops are worth
	part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
	part.FormFactor = "Custom"
	part.Size=Vector3.new(1.2, 1.2, 1.2) -- Size of the drops
	part.TopSurface = "Smooth"
	part.BottomSurface = "Smooth"
	game.Debris:AddItem(part,20) -- How long until the drops expire
end``

4 answers

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

In which case you would add this to your loop:

local Mesh = Instance.new("SpecialMesh", part)
Mesh.MeshType = Enum.MeshType.FileMesh
Mesh.MeshId = "Put the ID of your mesh here"

-- Simple enough.
-- Usually I would try to provide wiki links and such to help you learn but this doesn't seem
-- applicable here.
wait(2)
workspace:WaitForChild("PartStorage")

while true do
    wait(1.5) -- How long in between drops
    local part = Instance.new("Part",workspace.PartStorage)
part.Name=("PartOfCash")--if your dropper has a theme etc add t he name to partofcash so it doesnt mesh other parts!!
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!!--
meshpart.MeshType=("FileMesh")
meshpart.MeshId=("idhere")--add a id
meshpart.TextureId=("Textureidhere")--add a texture id here!!    
part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
    part.Material=script.Parent.Parent.Parent.MaterialValue.Value
    local cash = Instance.new("IntValue",part)
    cash.Name = "Cash"
    cash.Value = 5 -- How much the drops are worth
    part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
    part.FormFactor = "Custom"
    part.Size=Vector3.new(1.2, 1.2, 1.2) -- Size of the drops
    part.TopSurface = "Smooth"
    part.BottomSurface = "Smooth"
    game.Debris:AddItem(part,20) -- How long until the drops expire
end``

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

1 comment

0

Would really love if you accepted either one of our answers.

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)

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

while true do
	wait(1.5) -- How long in between drops
	local part = Instance.new("Part",workspace.PartStorage)
	part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
	part.Material=script.Parent.Parent.Parent.MaterialValue.Value

	local mesh = game.ServerStorage.Mesh:clone() -- This clones the mesh,
	mesh.Parent = part	 -- Into the part!
	
	local cash = Instance.new("IntValue",part)
	cash.Name = "Cash"
	cash.Value = 5 -- How much the drops are worth
	part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
	part.FormFactor = "Custom"
	part.Size=Vector3.new(1, 1, 0.25) -- Size of the drops
	part.TopSurface = "Smooth"
	part.BottomSurface = "Smooth"
	game.Debris:AddItem(part,20) -- How long until the drops expire
end

If it worked, please Accept the answer!

Any questions? Ask the in the comments!

Have a nice day!

This discussion is preserved as it was. New answers, comments, and votes are closed.