I'm trying to make it where a house disappears part by part by increasing the transparency of the part, but I also want this affect to apply to up to 4 other parts on the house before they are finished.
local house = script.Parent
local runservice = game:GetService("RunService")
local debounce = 0
for i,v in pairs(house:GetChildren()) do
if v:IsA("Part") then
if debounce < 4 then
debounce = debounce + 1
for i = 1,10 do
v.Transparency = v.Transparency + 0.1
wait()
end
debounce = debounce - 1
end
end
end
I want the first four parts that the first for loop calls upon, to all start disappearing 0.1 seconds from each other, and I don't want more parts to start disappearing until the first one out of these four have disappeared and so on. I know in my code the loop does each step once before repeating so it wouldn't work but I'm not sure how to repeat certain parts before other parts have finished. Help would greatly be appreciated!

1 comment
Yes! I used this for my debounce so that when the function was called on repeatedly with spawn, it would wait before progressing, thanks for your help.