Tycoon dropper question

Out of nowhere I just got stuck in making a tycoon, so I decided to start making a basic dropper. I got it to spawn with a proximity prompt,

And i made it produce blocks using instance.new
My problem is, I don’t know how to prevent it from dropping blocks from an invisible dropper. I want it to only start dropping when the proximity prompt is triggered.

sorry for og upload**

	local Drop = game.Workspace["Part 4"]
	local proxy = game.Workspace.proxy.ProximityPrompt -- PROXIMITY PROMPT VARIABLE NOT USED
	function MakeBlock()
		local Block = Instance.new("Part", game.Workspace)
		Block.CFrame = Drop.CFrame
		Block.Size = Vector3.new(2, 1, 2)
		Block.Material = Enum.Material.Concrete
		Block.BrickColor = BrickColor.new("White")
		game.Debris:AddItem(Block, 5)
	end

	while true do
		wait(1.5)
		MakeBlock()
	end


please help me.

Post snippet of code (The dropper part with instance.new)

i updated
I want this problem gone

Reference the proximity and then use the triggered event to trigger the while loop

I tweaked the code a bit. I don’t recommend using this method for multiple droppers, but instead insert each dropper inside a table and run the function for each dropper that has been triggered.

--// Variables
local Dropper = game.Workspace["Part 4"]
local ProximityPrompt = game.Workspace.proxy.ProximityPrompt
local Triggered = false

ProximityPrompt.Triggered:Connect(function()
	Triggered = true
end)

local function MakeBlock()
	local Block = Instance.new("Part")
	Block.Parent = workspace
	Block.CFrame = Dropper.CFrame
	Block.Size = Vector3.new(2, 1, 2)
	Block.Material = Enum.Material.Concrete
	Block.BrickColor = BrickColor.new("White")
	game.Debris:AddItem(Block, 5)
end

while true do
	if Triggered then
		task.wait(1.5)
		MakeBlock()
	end
	
	task.wait()
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.