In Game creating files (outside of game)

Hey, I was wonder after tons of research finding no answers, is it possible to use lua and create files then read them. By this I mean, creating an entire .lua file from within another lua file. For example: I have an ingame command that opens up a vgui with lets say its a ingame swep maker. In this ingame swep maker you can chose whatever you want from all around. (I mean like: Make your own swep, from any model and so by typing it in) then this file is saved as “(its name).lua”, is this possible? Or would I have to make a .txt with lua then read it and like for k,v in pairs( file.Read( so on ) ), to display it? Or can I just create .lua files?

Thanks, jacob.