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

How do I change what drops from the dropper? (please read text)!!!

Asked by 8 years ago

Hi I am currently making a tycoon...and I am using Zednov's Tycoon Kit I wanted to know how I can change the drops out of the Dropper to a mesh. now... I have searched It and there is one problem, I dont know where to put the added parts or where to modify the script, so I will leave the whole dropper script down below and please tell me which line I should paste it on!

Thanks :DD

01debounce = false
02script.Parent.Button.ClickDetector.MouseClick:connect(function()
03    if debounce == false then
04        debounce = true
05        script.Parent.Button.BrickColor=BrickColor.new("Bright red")
06        local part = Instance.new("Part",workspace)
07        local cash = Instance.new("IntValue",part)
08        cash.Name = "Cash"
09        part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
10        cash.Value = 1
11        part.CFrame = script.Parent.Drop.CFrame
12        part.Size=Vector3.new(1,1,1)
13        game.Debris:AddItem(part,20)
14        wait(0.2) -- Time to wait in between clicks
15        debounce = false
16        script.Parent.Button.BrickColor=BrickColor.new("Bright green")
17    end
18end)
0
Don't ask for code that you can copy and paste. This is a site to learn. User#11440 120 — 8y
0
This is why I unrecommend free models. You dont know anything they are doing SH_Helper 61 — 8y
0
First let me tell you. You won't learn like this. I highly advise you to check this blog post out. Read it thoroughly. Trust me. It is truly a big help. https://scriptinghelpers.org/blog/how-to-teach-yourself-lua Also, use the wiki. It sad and unfortunate but a lot of people refuse to use it. It's extremely helpful! AZDev 590 — 8y
0
The best thing I ever did when I was learning early on was make something myself. Trust me. The feeling you get when you make something, and YOU made it, is AMAZING. AZDev 590 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

You see this question was already answered before you need to search it but i'll help you

Firstly in the script we need to know where the part is inserted, Line 6,7

We would enter some new mesh such as local mesh=Instance.new("SpecialMesh",part)

Then we change that SpecialMesh, we can change meshes to different things and user created ones!

To use ones that are already loaded

We could use Enum

Now il show you the code that uses Enum.MeshType.Brick

01debounce = false
02script.Parent.Button.ClickDetector.MouseClick:connect(function()
03    if debounce == false then
04        debounce = true
05        script.Parent.Button.BrickColor=BrickColor.new("Bright red")
06        local part = Instance.new("Part",workspace)
07        local cash = Instance.new("IntValue",part)
08        local mesh = Instance.new("SpecialMesh",part)---This Inserts it to the part as its spawned
09        mesh.MeshType=Enum.MeshType.Brick--You can cycle through this
10        cash.Name = "Cash"
11        part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
12        cash.Value = 1
13        part.CFrame = script.Parent.Drop.CFrame
14        part.Size=Vector3.new(1,1,1)
15        game.Debris:AddItem(part,20)
16        wait(0.2) -- Time to wait in between clicks
17        debounce = false
18        script.Parent.Button.BrickColor=BrickColor.new("Bright green")
19    end
20end)

To use your own Meshid or Texture id we need to use Enum.MeshType.FileMesh

This makes the mesh a FileMesh where you can choose what mesh id you want and Texture id!

So we use Mesh.MeshId=("id here plz")--Id here and Mesh.TextureId=("Texture id here plzplz")--id here

heres a script that makes the mesh into a brain

01debounce = false
02script.Parent.Button.ClickDetector.MouseClick:connect(function()
03    if debounce == false then
04        debounce = true
05        script.Parent.Button.BrickColor=BrickColor.new("Bright red")
06        local part = Instance.new("Part",workspace)
07        local cash = Instance.new("IntValue",part)
08        local mesh = Instance.new("SpecialMesh",part)---This Inserts it to the part as its spawned
09        mesh.MeshType=Enum.MeshType.FileMesh--You can cycle through this
10        mesh.MeshId=("http://www.roblox.com/asset/?id=28199189")---makes the mesh a brain
11        mesh.TextureId=("http://www.roblox.com/asset/?id=23889683")---makes the brain have texture
12        cash.Name = "Cash"
13        part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
14        cash.Value = 1
15        part.CFrame = script.Parent.Drop.CFrame
View all 22 lines...

If you found this helpful please accept my answer

Thank you.

0
Thank you so much for helping me :D It helped a lot and I will take your advice kingwizard13093 5 — 8y
Ad

Answer this question