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

Mine isnt dropping a specific brick on game?

trying to make a mine for tycoon but it isnt dropping my specified object cant seem to figure out why anyone know?

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


deb = true 
script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
	if deb == true then
		deb = false
			local part = Instance.new(game.Workspace.MyTycoonKit.Tycoons.Survivalist.Purchases.Mine.Drop)
			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 = 1 -- How much the drops are worth
			part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)
			part.FormFactor = "Custom"
			part.Size=Vector3.new(1, 1, 1) -- Size of the drops
			part.TopSurface = "Smooth"
			part.BottomSurface = "Smooth"
			game.Debris:AddItem(part,20) -- How long until the drops expire
			wait(.15)
			deb = true
	end
end)

1 comment

0

Just make it Clone the Part? Like so, Local part = game.Workspace.MyTycoonKit.Tycoons.Survivalist.Purchases.Mine.Dro:Clone()

1 answer

I'll try to help you

Ok, so, first, what's that "wat" in 6th line? I think you should remove it!

script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat) --what's that wat doing there?

And after that being solved, I think what you want to do is Cloning, and not creating a new Instance. Here, what you want is this:

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


deb = true 
script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
    if deb == true then
        deb = false
            local part = game.Workspace.MyTycoonKit.Tycoons.Survivalist.Purchases.Mine.Drop:Clone()
            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 = 1 -- How much the drops are worth
            part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)
            part.FormFactor = "Custom"
            part.Size=Vector3.new(1, 1, 1) -- Size of the drops
            part.TopSurface = "Smooth"
            part.BottomSurface = "Smooth"
            game.Debris:AddItem(part,20) -- How long until the drops expire
            wait(.15)
            deb = true
    end
end)

If this solved your problem, let me know with a comment, and please mark as solved. As always, keep the good scripting ;)

2 comments

0

it still doesnt work and isnt giving any output saying its broken

0

If you're using a localscript, try using a script. If you're using a script, try with a localscript.

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