So basically I'm making a minigame's game, which has a certain gamemode which removes plates randomly. I have that all working, but there are layers of plates and depending on the time, another layer will start to fade away, like this:
if MapClone.Name == "Classic" then for i = 60, 1, -1 do Timer.Value = i wait() if i <= 35 then DMud() else DGrass() end end end
So the:
if i <= 35 then
tells the script if it is below or equal to 35 then run the function DMud() [Fade away another layer], but I want it so the layer under the top layer starts to fade away BEFORE it is completely gone. I know how to do this, but the problem is the script will give an error because the function cannot find anything it is trying to destroy.
Is there a way to do, if the children in a model is nothing (empty) so it has no children then.. blah.. blah blah.
I hope you can help.
There is a way!
local childrenInObject = object:GetChildren() --returns a table if #childrenInObject == 0 then --checking table length, table.getn(table) is deprecated --code here end