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.

3 comments
Thanks, is there anyway you can stop a function?
What do you mean by "stop a function?" I think I understand what you mean, but I can't really think of any situation where you would need to.
The function that is called, randomly makes the grass/mud dissappear. But if there is none left in the GetChildren() then it will crash and the entire script breaks, was wondering if you could do thr check, then stop the rest of the function.