If you’re wanting to make a plugin system I would say the easiest way is to use file.Find to include any lua files found in a directory then in those files modify a table. I can’t really put it into words too well but here’s an old dead project I started that has a decent plugin system.
The jist of it is to find all the files in a plugins directory, create a global table and then incude the plugin, the plugin will then modify that global table then return. After the plugin is done modifying the table you save the table to another table with some metadata to identify the plugins functions. Then keep doing that for all plugins found in the directory.