How to set a limit of children in a scrollbox?

Im trying to make a max and a current integer variables from getting the amount of children in a scroll box and setting a max amount so no more can be added to the scrollbox.

Here’s what I understood from the somewhat convoluted description:

If that’s not it, could you clarify a bit more?

Thanks for that helps a lot