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

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

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

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)

4 comments

0

Don't ask for code that you can copy and paste. This is a site to learn.

0

This is why I unrecommend free models. You dont know anything they are doing

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!

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.

1 answer

✓ Accepted answer

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

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)
		local mesh = Instance.new("SpecialMesh",part)---This Inserts it to the part as its spawned
		mesh.MeshType=Enum.MeshType.Brick--You can cycle through this
        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)

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

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)
		local mesh = Instance.new("SpecialMesh",part)---This Inserts it to the part as its spawned
		mesh.MeshType=Enum.MeshType.FileMesh--You can cycle through this
		mesh.MeshId=("http://www.roblox.com/asset/?id=28199189")---makes the mesh a brain
		mesh.TextureId=("http://www.roblox.com/asset/?id=23889683")---makes the brain have texture
        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)

If you found this helpful please accept my answer

Thank you.

1 comment

0

Thank you so much for helping me :D It helped a lot and I will take your advice

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