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.