How can I close functions after I close the script?

https://streamable.com/ac8ndg
Can I this by only making modules as children?

Here is the proper format for making module functions:

function module.FunctionName(VariableData)
   print("Foo!")
end

you dont use = for defining functions, thats more for calling functions and variables e.c.t. Its close attempt but its essential to properly set up functions.

Here’s two things I would like you to take note of:
– Modules do not maintain variable values after running
– They run as the same kind of script that called it. E.g called from local script runs as local

Here is the API for modules which will show you the fundamentals of modules:

Personally, I just use the collapse all folds which you can find in the right click menu or the shortcut to “close all the functions” (or pressing Ctrl+Shift+E). Not sure how to do it automatically when you reopen it though.