There are some typos and problems with your script, but I appreciate the effort you put in.
I kind of dislike how you did this, as it is confusing for me, so I'm going to remake your whole script to make it more simple and understandable. I'll explain how it works below the code block.
##Script
local model = workspace:WaitForChild('Model')
while wait(.1) do
local modeltable = model:GetDescendants()
if #modeltable == 0 then
break
end
local randompick = modeltable[math.random(#modeltable)]
if randompick:IsA('BasePart') then
for i = randompick.Transparency, 1, .1 do
wait()
randompick.Transparency = i
end
randompick:Destroy()
end
end
print('Broke')
##Explanation
I decided to do this in a loop. Every .1 seconds, the script gets the descendants and checks if there are any parts in the model. If there is, it'll continue, otherwise it'll break the whole loop and move on to the print. The script picks a random part through "randompick", checks if it actually a part, then changes its transparency to 1 based on the part's transparency (it'll make it look smoother now if any of your parts are already transparent). After it finishes making the part invisible completely, it'll destroy it. Then the loop makes the whole thing repeat until there are no parts left in the model.
Hope this helped!
1 comment
If you want it to be invisible, you should be adding transparency instead of subtracting it (although this may not be the solution) check line 09