I was wondering if it was possible to encode functions to string and back with Roblox Lua.
This is mainly for organizational purposes so I can store client and server functions in one module script in serverstorage and encode and send the client the functions they need, and no more.
This is not possible nor recommended. If youāre desiring to share code across Server and itās Clients, just use a ModuleScript placed in ReplicatedStorage. Itāll accomplish the same thing
Well regardless, you donāt want to expose the server side part of it, assuming youāre doing sanity checks on server, people could see that code and exploit it
When I say use a ModuleScript in ReplicatedStorage, Iām thinking more of a āfoundationā or ācoreā module for both Server and Client for maintaining a similar base for easier management of code. Definitely do not put functions which are dedicated to the Server in this Module. If any, put the core module along with any utilities/libraries which need to be shared, nothing else.