Near the last parts of the round, I get this error and it stops working
Error:
Basically, it should be removing the parts and play a little animation
Here is my code:
local PartsFolder = script.Parent.DisapearingParts
local Parts = PartsFolder:GetChildren()
while wait(2) do
local index = math.random(1, #Parts)
local PickedPart = Parts[index]
local index2 = math.random(1, #Parts)
local PickedPart2 = Parts[index2]
table.remove(Parts, index)
PickedPart.Color = Color3.fromRGB(255, 0, 0)
PickedPart.Material = "Neon"
wait()
for i = 0, 1.05, 0.05 do
PickedPart.Transparency = PickedPart.Transparency + 0.05
wait()
end
PickedPart.CanCollide = false
table.remove(Parts, index2)
PickedPart2.Color = Color3.fromRGB(255, 0, 0)
PickedPart2.Material = "Neon"
wait()
for i = 0, 1.05, 0.05 do
PickedPart2.Transparency = PickedPart2.Transparency + 0.05
wait()
end
PickedPart2.CanCollide = false
end
Edit: but there is still some left