Tycoon Dropper script

I’m attempting to make a tycoon dropper

I can’t find a way to make the parts disappear once they have hit the end of the conveyor

I tried adding a touched event and
Wait(5)
game.workspace.Part.Transparency = 1
game.workspace.Part.CanCollide = false
But it did not work…

Could you please paste the entire code in between here?

This is a code block. Use the symbol ` three times at the beginning of the code, and then close it using ` three times again.

I’m currently using the mobile app since I’m not at home

There’s quite a number of issues that needed to be pointed out here.

I highly recommend not doing this, as in case there are more than two parts with the name “Part”, then the script may not work well.

Not only that, but there is a way to automatically delete parts, using this simple function: game.Debris:AddItem(instance,waittime).

Secondly, you don’t need to paste this line of code again into the loop. Not only it’s unecessary, the NewPart has been already called in the loop.
image

I tried a separate script after that which was

    game.Workspace.Part.CanCollide = false
    game.Workspace.Part.Transparency = 1
end

Delete()

Script.Parent.Touched:Connect(Delete)```
local newPart = Instance.new("Part")
newPart.Size = Vector3.new(1,1,1)
newPart.BrickColor = BrickColor.Red()
newPart.Anchored = false
newPart.Position = Vector3.new(-241.334, 7.554, 8.335)
newPart.Material = Enum.Material.Slate
newPart.Parent = workspace

task.wait(2)

local newPart = Instance.new("Part")
newPart.Size = Vector3.new(1,1,1)
newPart.BrickColor = BrickColor.new("Really red")
newPart.Anchored = false
newPart.Position = Vector3.new(-241.334, 7.554, 8.335)
newPart.Material = Enum.Material.Slate
newPart.Parent = workspace

local part = workspace:WaitForChild("Part")
task.wait(5)
part.Transparency = 1
part.Cancollide = false
2 Likes

Oh yeah I did that so it would delay because it spawned 2 blocks close together so it looked like they were one whole part

task.spawn(function()
	while task.wait(2) do
		local newPart = Instance.new("Part")
		newPart.Size = Vector3.new(1,1,1)
		newPart.BrickColor = BrickColor.new("Really red")
		newPart.Anchored = false
		newPart.Position = Vector3.new(-241.334, 7.554, 8.335)
		newPart.Material = Enum.Material.Slate
		newPart.Parent = workspace
	end
end)

task.spawn(function()
	while task.wait(3) do
		if workspace:FindFirstChild("Part") then
			local part = workspace:FindFirstChild("Part")
			part.Transparency = 1
			part.Cancollide = false
		end
	end
end)
1 Like
task.spawn(function()
	while task.wait(2) do
		local newPart = Instance.new("Part")
		newPart.Size = Vector3.new(1,1,1)
		newPart.BrickColor = BrickColor.new("Really red")
		newPart.Anchored = false
		newPart.Position = Vector3.new(-241.334, 7.554, 8.335)
		newPart.Material = Enum.Material.Slate
		newPart.Parent = workspace
	end
end)

workspace.ChildAdded:Connect(function(child)
	if child:IsA("BasePart") then
		task.wait(2)
		child.Transparency = 1
		child.Cancollide = false
	end
end)
1 Like

You could have just added a task.wait(2) at the end of a loop like this:

while true do
     local newPart = Instance.new("Part")
     newPart.Size = Vector3.new(1,1,1)
     newPart.BrickColor = BrickColor.Red()
     newPart.Anchored = false
     newPart.Position = Vector3.new(-241.334, 7.554, 8.335)
     newPart.Material = Enum.Material.Slate
     newPart.Parent = workspace
     task.wait(2)
end

And it would delay.

Thank you, I also didn’t know task could be used in the beginning of a line, then again I am still new to scripting

I’m still quite new to scripting, i normally just do simple color sequence scripts haha, this was my first actual functional one besides the parts not disappearing, I just put that down to the parts being the same name

Lol, sorry if i sounded rude btw.
@Forummer’s code is really good so you should follow his idea as well

1 Like

Not rude at all don’t worry lol
Indeed it is, thank you for your help aswell!