8O8Mph
(8O8Mph)
December 3, 2021, 1:03pm
#1
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.
8O8Mph
(8O8Mph)
December 3, 2021, 1:11pm
#3
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.
8O8Mph
(8O8Mph)
December 3, 2021, 1:19pm
#6
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)```
Forummer
(Forummer)
December 3, 2021, 1:20pm
#7
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
8O8Mph
(8O8Mph)
December 3, 2021, 1:20pm
#8
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
Forummer
(Forummer)
December 3, 2021, 1:22pm
#9
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
Forummer
(Forummer)
December 3, 2021, 1:22pm
#10
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.
8O8Mph
(8O8Mph)
December 3, 2021, 1:23pm
#12
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
8O8Mph
(8O8Mph)
December 3, 2021, 1:25pm
#13
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
8O8Mph
(8O8Mph)
December 3, 2021, 1:28pm
#15
Not rude at all don’t worry lol
Indeed it is, thank you for your help aswell!